2016-02-02 05:35:19 +01:00
|
|
|
FROM alpine:edge
|
|
|
|
MAINTAINER adam@diginc.us <adam@diginc.us>
|
|
|
|
|
2016-10-07 02:46:20 +02:00
|
|
|
ENV IMAGE alpine
|
|
|
|
|
2016-11-13 01:08:38 +01:00
|
|
|
ENV TINI_VERSION v0.13.0
|
|
|
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini
|
|
|
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static.asc /tini.asc
|
|
|
|
|
|
|
|
# Tini and package requirements
|
|
|
|
RUN apk add --update gpgme && \
|
|
|
|
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 0527A9B7 && \
|
|
|
|
gpg --verify /tini.asc && \
|
|
|
|
chmod +x /tini && \
|
|
|
|
apk add \
|
2016-02-02 05:35:19 +01:00
|
|
|
dnsmasq \
|
2016-02-13 20:24:44 +01:00
|
|
|
nginx \
|
2016-02-02 05:35:19 +01:00
|
|
|
ca-certificates \
|
2016-06-16 06:27:16 +02:00
|
|
|
php5-fpm php5-json php5-openssl libxml2 \
|
2016-11-13 01:08:38 +01:00
|
|
|
bc bash curl perl sudo git && \
|
2016-02-02 05:35:19 +01:00
|
|
|
rm -rf /var/cache/apk/*
|
|
|
|
|
2016-02-13 20:24:44 +01:00
|
|
|
# Customized from submodules
|
2016-10-21 05:36:55 +02:00
|
|
|
COPY ./pi-hole/gravity.sh /usr/local/bin/
|
|
|
|
COPY ./pi-hole/advanced/Scripts/* /usr/local/bin/
|
2016-10-30 18:13:52 +01:00
|
|
|
COPY ./pi-hole/pihole /usr/local/bin/
|
2016-11-06 20:42:38 +01:00
|
|
|
RUN sed -i 's|service dnsmasq restart|kill -9 $(pidof dnsmasq); dnsmasq -7 /etc/dnsmasq.d|g' \
|
|
|
|
/usr/local/bin/pihole \
|
|
|
|
/usr/local/bin/gravity.sh \
|
|
|
|
/usr/local/bin/list.sh
|
|
|
|
RUN sed -i 's|service dnsmasq start|dnsmasq -7 /etc/dnsmasq.d|g' \
|
2016-10-30 18:13:52 +01:00
|
|
|
/usr/local/bin/pihole \
|
2016-10-21 05:36:55 +02:00
|
|
|
/usr/local/bin/gravity.sh \
|
2016-10-30 18:13:52 +01:00
|
|
|
/usr/local/bin/list.sh
|
2016-02-13 20:24:44 +01:00
|
|
|
COPY ./alpine/nginx.conf /etc/nginx/nginx.conf
|
2016-10-21 05:36:55 +02:00
|
|
|
|
2016-02-13 20:24:44 +01:00
|
|
|
# Original upstream pihole code being used
|
2016-02-13 23:11:04 +01:00
|
|
|
COPY ./pi-hole/adlists.default /etc/pihole/
|
2016-08-31 02:21:17 +02:00
|
|
|
COPY ./pi-hole/adlists.default /etc/.pihole/
|
2016-05-11 17:41:06 +02:00
|
|
|
RUN mkdir -p /opt/ && ln -s /usr/local/bin /opt/pihole
|
2016-04-26 06:18:41 +02:00
|
|
|
COPY ./pi-hole/advanced/dnsmasq.conf.original /etc/dnsmasq.conf
|
|
|
|
COPY ./pi-hole/advanced/01-pihole.conf /etc/dnsmasq.d/
|
2016-08-28 09:15:56 +02:00
|
|
|
COPY ./pi-hole/advanced/index* /var/www/html/pihole/
|
2016-06-16 07:10:14 +02:00
|
|
|
COPY ./pi-hole/advanced/pihole.sudo /etc/sudoers.d/pihole
|
2016-02-02 05:35:19 +01:00
|
|
|
COPY ./AdminLTE /var/www/html/admin
|
2016-03-30 02:51:08 +02:00
|
|
|
COPY ./AdminLTE_version.txt /etc/
|
|
|
|
COPY ./pi-hole_version.txt /etc/
|
2016-02-02 05:35:19 +01:00
|
|
|
|
2016-07-08 06:34:41 +02:00
|
|
|
# Things installer did and fix alpine+nginx differences
|
|
|
|
ENV WEBLOGDIR /var/log/nginx
|
|
|
|
ENV PHP_CONFIG '/etc/php5/php-fpm.conf'
|
2016-02-13 20:24:44 +01:00
|
|
|
RUN mkdir -p /etc/pihole/ && \
|
|
|
|
mkdir -p /var/www/html/pihole && \
|
|
|
|
mkdir -p /var/www/html/admin/ && \
|
|
|
|
chown nginx:nginx /var/www/html && \
|
2016-07-08 06:34:41 +02:00
|
|
|
touch ${WEBLOGDIR}/access.log ${WEBLOGDIR}/error.log && \
|
|
|
|
chown -R nginx:nginx ${WEBLOGDIR} && \
|
|
|
|
sed -i 's|^user\s*=.*$|user = nginx|' $PHP_CONFIG && \
|
2016-02-13 20:24:44 +01:00
|
|
|
chmod 775 /var/www/html && \
|
|
|
|
touch /var/log/pihole.log && \
|
|
|
|
chmod 644 /var/log/pihole.log && \
|
|
|
|
chown dnsmasq:root /var/log/pihole.log && \
|
2016-04-26 06:18:41 +02:00
|
|
|
sed -i "s/@INT@/eth0/" /etc/dnsmasq.d/01-pihole.conf && \
|
2016-03-30 02:51:08 +02:00
|
|
|
sed -i 's|"cd /etc/.pihole/ && git describe --tags --abbrev=0"|"cat /etc/pi-hole_version.txt"|g' /var/www/html/admin/footer.php && \
|
2016-07-10 06:07:50 +02:00
|
|
|
sed -i 's|"git describe --tags --abbrev=0"|"cat /etc/AdminLTE_version.txt"|g' /var/www/html/admin/footer.php && \
|
2016-07-08 06:34:41 +02:00
|
|
|
sed -i 's|www-data|nginx|g' /etc/sudoers.d/pihole && \
|
|
|
|
/bin/true # placeholder
|
2016-02-13 20:24:44 +01:00
|
|
|
|
2016-04-26 06:18:41 +02:00
|
|
|
# This chould be eliminated if all (upstream) files were +x in git
|
2016-02-13 20:24:44 +01:00
|
|
|
RUN chmod +x /usr/local/bin/*.sh
|
2016-04-26 06:18:41 +02:00
|
|
|
|
|
|
|
# Fix dnsmasq in docker
|
2016-02-13 20:24:44 +01:00
|
|
|
RUN grep -q '^user=root' || echo 'user=root' >> /etc/dnsmasq.conf
|
|
|
|
|
2016-07-08 06:34:41 +02:00
|
|
|
# php config start passes special ENVs into
|
|
|
|
ENV PHP_ENV_CONFIG '/etc/php5/fpm.d/envs.conf'
|
|
|
|
ENV PHP_ERROR_LOG '/var/log/nginx/error.log'
|
2016-10-30 18:13:52 +01:00
|
|
|
COPY ./start.sh /
|
2016-10-30 19:47:06 +01:00
|
|
|
COPY ./bash_functions.sh /
|
2016-02-13 20:24:44 +01:00
|
|
|
|
2016-09-01 05:10:53 +02:00
|
|
|
# IPV6 disable flag for networks/devices that do not support it
|
|
|
|
ENV IPv6 True
|
|
|
|
|
2016-02-13 20:24:44 +01:00
|
|
|
EXPOSE 53 53/udp
|
|
|
|
EXPOSE 80
|
|
|
|
|
2016-11-13 01:08:38 +01:00
|
|
|
ENTRYPOINT ["/tini", "--"]
|
|
|
|
CMD [ "/start.sh" ]
|