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
|
2017-01-08 17:42:39 +01:00
|
|
|
ENV PATH /opt/pihole:${PATH}
|
|
|
|
|
|
|
|
COPY install.sh /install.sh
|
2017-01-09 02:13:16 +01:00
|
|
|
COPY ./alpine/service /usr/local/bin/service
|
2017-01-08 17:42:39 +01:00
|
|
|
ENV setupVars /etc/pihole/setupVars.conf
|
|
|
|
ENV PIHOLE_INSTALL /tmp/ph_install.sh
|
2016-10-07 02:46:20 +02:00
|
|
|
|
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
|
2017-01-08 17:42:39 +01:00
|
|
|
RUN apk add --update 'gnupg<2.1.17-r0' && \
|
2016-11-13 01:08:38 +01:00
|
|
|
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 0527A9B7 && \
|
|
|
|
gpg --verify /tini.asc && \
|
|
|
|
chmod +x /tini && \
|
2017-01-08 17:42:39 +01:00
|
|
|
apk add wget bash && \
|
|
|
|
/install.sh && \
|
2016-02-02 05:35:19 +01:00
|
|
|
rm -rf /var/cache/apk/*
|
|
|
|
|
2016-02-13 20:24:44 +01:00
|
|
|
# Customized from submodules
|
|
|
|
COPY ./alpine/nginx.conf /etc/nginx/nginx.conf
|
2016-10-21 05:36:55 +02: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 && \
|
2017-01-09 02:13:16 +01:00
|
|
|
echo 'Done!'
|
2016-04-26 06:18:41 +02:00
|
|
|
|
2017-01-09 02:13:16 +01: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 && \
|
|
|
|
#sed -i 's|"git describe --tags --abbrev=0"|"cat /etc/AdminLTE_version.txt"|g' /var/www/html/admin/footer.php && \
|
|
|
|
#sed -i 's|www-data|nginx|g' /etc/sudoers.d/pihole && \
|
2016-02-13 20:24:44 +01:00
|
|
|
|
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
|
|
|
|
|
2017-01-18 05:49:42 +01:00
|
|
|
SHELL ["/bin/bash", "-c"]
|
2016-11-13 01:08:38 +01:00
|
|
|
ENTRYPOINT ["/tini", "--"]
|
|
|
|
CMD [ "/start.sh" ]
|