commit 94ef971f713db7460c236f06b361903f8b36997e Author: diginc Date: Mon Feb 1 22:35:19 2016 -0600 initial version of monolithic debian docker & WIP alpine. * Submodules of pi-hole source for copying into docker images * git submodules...yuk. * debian builds and runs pi-hole apps/configs on jessie docker * useful base line for merge and testing upstream updates * Linux x86/64 image, would like to try raspian ARM docker image base too * WIP alpine dockerfile * will need more custom lighttpd config(s) at a minimum * again there is an ARM alpine version so running on pi is future possibility diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d9233ba --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# My personal test non-stock docker-compose.yml file +doco.yml + +*.swp diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e51dfdb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "pi-hole"] + path = pi-hole + url = git@github.com:diginc/pi-hole.git +[submodule "AdminLTE"] + path = AdminLTE + url = https://github.com/pi-hole/AdminLTE.git diff --git a/AdminLTE b/AdminLTE new file mode 160000 index 0000000..6793459 --- /dev/null +++ b/AdminLTE @@ -0,0 +1 @@ +Subproject commit 67934591fecf90ed08afef78518e518867fdff49 diff --git a/README.md b/README.md new file mode 100644 index 0000000..3060946 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +A Docker project to make lightweight continers with pi-hole https://pi-hole.net functionality diff --git a/alpine.docker b/alpine.docker new file mode 100644 index 0000000..e0be565 --- /dev/null +++ b/alpine.docker @@ -0,0 +1,29 @@ +FROM alpine:edge +MAINTAINER adam@diginc.us + +RUN apk add --update --repository http://dl-1.alpinelinux.org/alpine/edge/testing/ tini +ENTRYPOINT ["tini", "--"] + +RUN apk update && \ + apk add \ + dnsmasq \ + lighttpd \ + ca-certificates \ + php-fpm php-json php-zlib php-xml \ + php-pdo php-phar php-openssl \ + php-gd php-iconv php-mcrypt && \ + apk add -u musl && \ + rm -rf /var/cache/apk/* + +# Hit wall with /usr/share/lighttpd/*.pl not existing on alpine, +# will need custom configs +# maybe just switch to nginx... +COPY ./pi-hole/gravity.sh /usr/local/bin/ +COPY ./pi-hole/advanced/Scripts/* /usr/local/bin/ +COPY ./pi-hole/advanced/lighttpd.conf /etc/lighttpd/lighttpd.conf +COPY ./pi-hole/advanced/dnsmasq.conf /etc/dnsmasq.conf +COPY ./pi-hole/advanced/index.html /var/www/html/pihole/index.html +COPY ./AdminLTE /var/www/html/admin + +COPY start.sh / +CMD /start.sh diff --git a/debian.docker b/debian.docker new file mode 100644 index 0000000..bfb1b98 --- /dev/null +++ b/debian.docker @@ -0,0 +1,46 @@ +FROM debian:jessie +MAINTAINER adam@diginc.us + +ENV TINI_VERSION v0.9.0 +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 \ + php5-common php5-cgi php5 \ + curl unzip wget && \ + rm -rf /var/cache/apt/archives + +# Setup +COPY ./pi-hole/gravity.sh /usr/local/bin/ +COPY ./pi-hole/advanced/Scripts/* /usr/local/bin/ +COPY ./pi-hole/advanced/lighttpd.conf /etc/lighttpd/lighttpd.conf +COPY ./pi-hole/advanced/dnsmasq.conf /etc/dnsmasq.conf +COPY ./pi-hole/advanced/index.html /var/www/html/pihole/index.html +COPY ./AdminLTE /var/www/html/admin + +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 && \ + 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 && \ + sed -i "s/@INT@/eth0/" /etc/dnsmasq.conf + +# This chould be eliminated if the files were +x in git +RUN chmod +x /usr/local/bin/*.sh +# Fix just for docker +RUN grep -q '^user=root' || echo 'user=root' >> /etc/dnsmasq.conf + +COPY ./start.sh / +ENTRYPOINT ["/tini", "--"] +CMD /start.sh diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..bfc000f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +debian: + build: . + dockerfile: debian.docker + ports: + - "53:53/tcp" + - "53:53/udp" + - "8053:80/tcp" + cap_add: + - NET_ADMIN diff --git a/pi-hole b/pi-hole new file mode 160000 index 0000000..52b5d71 --- /dev/null +++ b/pi-hole @@ -0,0 +1 @@ +Subproject commit 52b5d7143bac8e514461aae4e563c534a1409704 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e41f756 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +docker-compose diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..8a61a09 --- /dev/null +++ b/start.sh @@ -0,0 +1,8 @@ +#!/bin/sh + + +service lighttpd start +gravity.sh # dnsmasq start included + +tail -f /var/log/lighttpd/*.log /var/log/pihole.log +