mirror of
https://github.com/pi-hole/docker-pi-hole.git
synced 2025-12-20 02:18:51 +00:00
armel build script and dockerfile stuffs
Signed-off-by: Adam Hill <adam@diginc.us>
This commit is contained in:
@@ -7,6 +7,7 @@ env:
|
|||||||
- QEMU_VER=v2.9.1
|
- QEMU_VER=v2.9.1
|
||||||
matrix:
|
matrix:
|
||||||
- OS=debian ARCH=amd64
|
- OS=debian ARCH=amd64
|
||||||
|
- OS=debian ARCH=armel
|
||||||
- OS=debian ARCH=armhf
|
- OS=debian ARCH=armhf
|
||||||
- OS=debian ARCH=aarch64
|
- OS=debian ARCH=aarch64
|
||||||
python:
|
python:
|
||||||
|
|||||||
@@ -3,14 +3,14 @@
|
|||||||
""" Dockerfile.py - generates and build dockerfiles
|
""" Dockerfile.py - generates and build dockerfiles
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
Dockerfile.py [--os=<os> ...] [--arch=<arch> ...] [-v] [--no-build | --no-generate] [--no-cache]
|
Dockerfile.py [--os=<os> ...] [--arch=<arch> ...] [--skip=<arch> ...] [-v] [--no-build | --no-generate] [--no-cache]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
--no-build Skip building the docker images
|
--no-build Skip building the docker images
|
||||||
--no-cache Build without using any cache data
|
--no-cache Build without using any cache data
|
||||||
--no-generate Skip generating Dockerfiles from template
|
--no-generate Skip generating Dockerfiles from template
|
||||||
--os=<os> What OS(s) to build [default: debian]
|
--arch=<arch> What Architecture(s) to build [default: amd64 armel armhf aarch64]
|
||||||
--arch=<arch> What Architecture(s) to build [default: amd64 armhf aarch64]
|
--skip=<arch> What Architectures(s) to skip [default: None]
|
||||||
-v Print docker's command output [default: False]
|
-v Print docker's command output [default: False]
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
@@ -27,7 +27,7 @@ THIS_DIR = os.path.dirname(os.path.abspath(__file__))
|
|||||||
base_vars = {
|
base_vars = {
|
||||||
'name': 'diginc/pi-hole',
|
'name': 'diginc/pi-hole',
|
||||||
'maintainer' : 'adam@diginc.us',
|
'maintainer' : 'adam@diginc.us',
|
||||||
's6_version' : 'v1.21.2.2',
|
's6_version' : 'v1.21.4.0',
|
||||||
}
|
}
|
||||||
|
|
||||||
os_base_vars = {
|
os_base_vars = {
|
||||||
@@ -43,6 +43,10 @@ images = {
|
|||||||
'base': 'debian:stretch',
|
'base': 'debian:stretch',
|
||||||
'arch': 'amd64'
|
'arch': 'amd64'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'base': 'multiarch/debian-debootstrap:armel-stretch-slim',
|
||||||
|
'arch': 'armel'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'base': 'multiarch/debian-debootstrap:armhf-stretch-slim',
|
'base': 'multiarch/debian-debootstrap:armhf-stretch-slim',
|
||||||
'arch': 'armhf'
|
'arch': 'armhf'
|
||||||
@@ -61,13 +65,18 @@ def generate_dockerfiles(args):
|
|||||||
|
|
||||||
for os, archs in images.iteritems():
|
for os, archs in images.iteritems():
|
||||||
for image in archs:
|
for image in archs:
|
||||||
if os not in args['--os'] and image['arch'] not in args['--arch']:
|
if os not in args['--os'] and image['arch'] not in args['--arch'] or \
|
||||||
|
image['arch'] in args['--skip']:
|
||||||
return
|
return
|
||||||
|
s6arch = image['arch']
|
||||||
|
if image['arch'] == 'armel':
|
||||||
|
s6arch = 'arm'
|
||||||
merged_data = dict(
|
merged_data = dict(
|
||||||
{ 'os': os }.items() +
|
{ 'os': os }.items() +
|
||||||
base_vars.items() +
|
base_vars.items() +
|
||||||
os_base_vars[os].items() +
|
os_base_vars[os].items() +
|
||||||
image.items()
|
image.items() +
|
||||||
|
{ 's6arch': s6arch }.items()
|
||||||
)
|
)
|
||||||
j2_env = Environment(loader=FileSystemLoader(THIS_DIR),
|
j2_env = Environment(loader=FileSystemLoader(THIS_DIR),
|
||||||
trim_blocks=True)
|
trim_blocks=True)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ ENV PATH /opt/pihole:${PATH}
|
|||||||
COPY install.sh /usr/local/bin/docker-install.sh
|
COPY install.sh /usr/local/bin/docker-install.sh
|
||||||
ENV setupVars /etc/pihole/setupVars.conf
|
ENV setupVars /etc/pihole/setupVars.conf
|
||||||
ENV PIHOLE_INSTALL /tmp/ph_install.sh
|
ENV PIHOLE_INSTALL /tmp/ph_install.sh
|
||||||
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/{{ pihole.s6_version }}/s6-overlay-{{ pihole.arch }}.tar.gz
|
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/{{ pihole.s6_version }}/s6-overlay-{{ pihole.s6arch }}.tar.gz
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y wget curl net-tools cron procps && \
|
apt-get install -y wget curl net-tools cron procps && \
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ ENV PATH /opt/pihole:${PATH}
|
|||||||
COPY install.sh /usr/local/bin/docker-install.sh
|
COPY install.sh /usr/local/bin/docker-install.sh
|
||||||
ENV setupVars /etc/pihole/setupVars.conf
|
ENV setupVars /etc/pihole/setupVars.conf
|
||||||
ENV PIHOLE_INSTALL /tmp/ph_install.sh
|
ENV PIHOLE_INSTALL /tmp/ph_install.sh
|
||||||
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.2.2/s6-overlay-aarch64.tar.gz
|
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.4.0/s6-overlay-aarch64.tar.gz
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y wget curl net-tools cron procps && \
|
apt-get install -y wget curl net-tools cron procps && \
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ ENV PATH /opt/pihole:${PATH}
|
|||||||
COPY install.sh /usr/local/bin/docker-install.sh
|
COPY install.sh /usr/local/bin/docker-install.sh
|
||||||
ENV setupVars /etc/pihole/setupVars.conf
|
ENV setupVars /etc/pihole/setupVars.conf
|
||||||
ENV PIHOLE_INSTALL /tmp/ph_install.sh
|
ENV PIHOLE_INSTALL /tmp/ph_install.sh
|
||||||
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.2.2/s6-overlay-amd64.tar.gz
|
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.4.0/s6-overlay-amd64.tar.gz
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y wget curl net-tools cron procps && \
|
apt-get install -y wget curl net-tools cron procps && \
|
||||||
|
|||||||
50
Dockerfile_debian_armel
Normal file
50
Dockerfile_debian_armel
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
FROM multiarch/debian-debootstrap:armel-stretch-slim
|
||||||
|
|
||||||
|
LABEL image="diginc/pi-hole:debian_armel"
|
||||||
|
LABEL maintainer="adam@diginc.us"
|
||||||
|
LABEL url="https://www.github.com/diginc/docker-pi-hole"
|
||||||
|
|
||||||
|
ENV TAG debian
|
||||||
|
ENV ARCH armel
|
||||||
|
ENV PATH /opt/pihole:${PATH}
|
||||||
|
|
||||||
|
COPY install.sh /usr/local/bin/docker-install.sh
|
||||||
|
ENV setupVars /etc/pihole/setupVars.conf
|
||||||
|
ENV PIHOLE_INSTALL /tmp/ph_install.sh
|
||||||
|
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.4.0/s6-overlay-arm.tar.gz
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y wget curl net-tools cron procps && \
|
||||||
|
curl -L -s $S6OVERLAY_RELEASE \
|
||||||
|
| tar xvzf - -C / && \
|
||||||
|
docker-install.sh && \
|
||||||
|
rm -rf /var/cache/apt/archives /var/lib/apt/lists/* && \
|
||||||
|
mv /init /s6-init
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/s6-init" ]
|
||||||
|
|
||||||
|
ADD s6/debian-root /
|
||||||
|
COPY s6/service /usr/local/bin/service
|
||||||
|
|
||||||
|
# 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'
|
||||||
|
COPY ./start.sh /
|
||||||
|
COPY ./bash_functions.sh /
|
||||||
|
|
||||||
|
# IPv6 disable flag for networks/devices that do not support it
|
||||||
|
ENV IPv6 True
|
||||||
|
|
||||||
|
EXPOSE 53 53/udp
|
||||||
|
EXPOSE 67/udp
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
ENV S6_LOGGING 0
|
||||||
|
ENV S6_KEEP_ENV 1
|
||||||
|
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS 2
|
||||||
|
ENV FTL_CMD no-daemon
|
||||||
|
|
||||||
|
HEALTHCHECK CMD dig @127.0.0.1 pi.hole || exit 1
|
||||||
|
|
||||||
|
SHELL ["/bin/bash", "-c"]
|
||||||
@@ -11,7 +11,7 @@ ENV PATH /opt/pihole:${PATH}
|
|||||||
COPY install.sh /usr/local/bin/docker-install.sh
|
COPY install.sh /usr/local/bin/docker-install.sh
|
||||||
ENV setupVars /etc/pihole/setupVars.conf
|
ENV setupVars /etc/pihole/setupVars.conf
|
||||||
ENV PIHOLE_INSTALL /tmp/ph_install.sh
|
ENV PIHOLE_INSTALL /tmp/ph_install.sh
|
||||||
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.2.2/s6-overlay-armhf.tar.gz
|
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.4.0/s6-overlay-armhf.tar.gz
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y wget curl net-tools cron procps && \
|
apt-get install -y wget curl net-tools cron procps && \
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ def DockerPersist(request, persist_args, persist_image, persist_cmd, Dig):
|
|||||||
def args(request):
|
def args(request):
|
||||||
return '-e ServerIP="127.0.0.1" -e ServerIPv6="::1"'
|
return '-e ServerIP="127.0.0.1" -e ServerIPv6="::1"'
|
||||||
|
|
||||||
@pytest.fixture(params=['amd64', 'armhf', 'aarch64'])
|
@pytest.fixture(params=['amd64', 'armel', 'armhf', 'aarch64'])
|
||||||
def arch(request):
|
def arch(request):
|
||||||
return request.param
|
return request.param
|
||||||
|
|
||||||
|
|||||||
8
tox.ini
8
tox.ini
@@ -5,5 +5,9 @@ envlist = py27
|
|||||||
whitelist_externals = docker
|
whitelist_externals = docker
|
||||||
deps = -rrequirements.txt
|
deps = -rrequirements.txt
|
||||||
commands = docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
commands = docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||||
./Dockerfile.py -v
|
./Dockerfile.py -v --arch amd64
|
||||||
pytest {posargs:-vv -n auto} ./test/
|
pytest -vv -n auto -k amd64 ./test/
|
||||||
|
./Dockerfile.py -v --skip amd64
|
||||||
|
pytest -vv -n auto -k armel ./test/
|
||||||
|
pytest -vv -n auto -k armhf ./test/
|
||||||
|
pytest -vv -n auto -k aarch64 ./test/
|
||||||
|
|||||||
Reference in New Issue
Block a user