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
This commit is contained in:
diginc 2016-02-01 22:35:19 -06:00
commit 94ef971f71
10 changed files with 106 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# My personal test non-stock docker-compose.yml file
doco.yml
*.swp

6
.gitmodules vendored Normal file
View File

@ -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

1
AdminLTE Submodule

@ -0,0 +1 @@
Subproject commit 67934591fecf90ed08afef78518e518867fdff49

1
README.md Normal file
View File

@ -0,0 +1 @@
A Docker project to make lightweight continers with pi-hole https://pi-hole.net functionality

29
alpine.docker Normal file
View File

@ -0,0 +1,29 @@
FROM alpine:edge
MAINTAINER adam@diginc.us <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

46
debian.docker Normal file
View File

@ -0,0 +1,46 @@
FROM debian:jessie
MAINTAINER adam@diginc.us <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

9
docker-compose.yml Normal file
View File

@ -0,0 +1,9 @@
debian:
build: .
dockerfile: debian.docker
ports:
- "53:53/tcp"
- "53:53/udp"
- "8053:80/tcp"
cap_add:
- NET_ADMIN

1
pi-hole Submodule

@ -0,0 +1 @@
Subproject commit 52b5d7143bac8e514461aae4e563c534a1409704

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
docker-compose

8
start.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
service lighttpd start
gravity.sh # dnsmasq start included
tail -f /var/log/lighttpd/*.log /var/log/pihole.log