2016-02-02 05:35:19 +01:00
|
|
|
FROM debian:jessie
|
|
|
|
MAINTAINER adam@diginc.us <adam@diginc.us>
|
|
|
|
|
2016-10-07 02:46:20 +02:00
|
|
|
ENV IMAGE debian
|
|
|
|
|
2016-10-21 05:36:55 +02:00
|
|
|
ENV TINI_VERSION v0.10.0
|
2016-02-02 05:35:19 +01:00
|
|
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
|
|
|
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
|
|
|
|
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 0527A9B7 \
|
|
|
|
&& gpg --verify /tini.asc
|
|
|
|
RUN chmod +x /tini
|
|
|
|
|
|
|
|
# Requirements
|
|
|
|
RUN apt-get -q update && \
|
|
|
|
apt-get install -y \
|
|
|
|
dnsmasq \
|
|
|
|
lighttpd \
|
2016-06-16 07:10:14 +02:00
|
|
|
php5-common php5-cgi php5 \
|
2016-10-07 01:51:05 +02:00
|
|
|
bc curl unzip wget sudo dnsutils && \
|
2016-02-02 05:35:19 +01:00
|
|
|
rm -rf /var/cache/apt/archives
|
|
|
|
|
2016-02-13 23:11:04 +01:00
|
|
|
# Original upstream pihole code being used
|
2016-02-02 05:35:19 +01:00
|
|
|
COPY ./pi-hole/gravity.sh /usr/local/bin/
|
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-04-26 06:18:41 +02:00
|
|
|
COPY ./pi-hole/pihole /usr/local/bin/
|
2016-02-02 05:35:19 +01:00
|
|
|
COPY ./pi-hole/advanced/Scripts/* /usr/local/bin/
|
2016-05-11 17:41:06 +02:00
|
|
|
RUN mkdir -p /opt/ && ln -s /usr/local/bin /opt/pihole
|
2016-07-16 05:47:42 +02:00
|
|
|
COPY ./pi-hole/advanced/lighttpd.conf.debian /etc/lighttpd/lighttpd.conf
|
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/
|
|
|
|
RUN rm /var/www/html/index.lighttpd.html
|
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-10-21 05:36:55 +02:00
|
|
|
# Make pihole scripts fail searching for `systemctl`,
|
|
|
|
# which fails pretty miserably in docker compared to `service`
|
|
|
|
# For more info see docker/docker issue #7459
|
|
|
|
RUN mv `which systemctl` /bin/no_systemctl
|
2016-02-02 05:35:19 +01:00
|
|
|
|
2016-07-08 06:34:41 +02:00
|
|
|
ENV WEBLOGDIR /var/log/lighttpd
|
2016-02-02 05:35:19 +01:00
|
|
|
RUN mkdir -p /etc/pihole/ && \
|
|
|
|
mkdir -p /var/www/html/pihole && \
|
|
|
|
mkdir -p /var/www/html/admin/ && \
|
|
|
|
chown www-data:www-data /var/www/html && \
|
2016-07-08 06:34:41 +02:00
|
|
|
touch ${WEBLOGDIR}/access.log ${WEBLOGDIR}/error.log && \
|
|
|
|
chown -R www-data.www-data ${WEBLOGDIR} && \
|
2016-02-02 05:35:19 +01:00
|
|
|
chmod 775 /var/www/html && \
|
|
|
|
lighty-enable-mod fastcgi fastcgi-php || true && \
|
|
|
|
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-02-02 05:35:19 +01:00
|
|
|
|
2016-04-26 06:18:41 +02:00
|
|
|
# This chould be eliminated if all (upstream) files were +x in git
|
2016-02-02 05:35:19 +01:00
|
|
|
RUN chmod +x /usr/local/bin/*.sh
|
2016-04-26 06:18:41 +02:00
|
|
|
|
|
|
|
# Fix dnsmasq in docker
|
2016-02-02 05:35:19 +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/lighttpd/conf-enabled/15-fastcgi-php.conf'
|
|
|
|
ENV PHP_ERROR_LOG '/var/log/lighttpd/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-04-26 06:18:41 +02:00
|
|
|
|
2016-10-21 05:36:55 +02:00
|
|
|
# IPv6 disable flag for networks/devices that do not support it
|
2016-09-01 05:10:53 +02:00
|
|
|
# not fully supported in debian yet
|
|
|
|
ENV IPv6 True
|
|
|
|
|
2016-04-26 06:18:41 +02:00
|
|
|
EXPOSE 53 53/udp
|
|
|
|
EXPOSE 80
|
|
|
|
|
2016-02-02 05:35:19 +01:00
|
|
|
ENTRYPOINT ["/tini", "--"]
|
|
|
|
CMD /start.sh
|