armel build script and dockerfile stuffs
Signed-off-by: Adam Hill <adam@diginc.us>
This commit is contained in:
parent
f770df9504
commit
c17cd37eca
|
@ -7,6 +7,7 @@ env:
|
|||
- QEMU_VER=v2.9.1
|
||||
matrix:
|
||||
- OS=debian ARCH=amd64
|
||||
- OS=debian ARCH=armel
|
||||
- OS=debian ARCH=armhf
|
||||
- OS=debian ARCH=aarch64
|
||||
python:
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
""" Dockerfile.py - generates and build dockerfiles
|
||||
|
||||
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:
|
||||
--no-build Skip building the docker images
|
||||
--no-cache Build without using any cache data
|
||||
--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 armhf aarch64]
|
||||
--arch=<arch> What Architecture(s) to build [default: amd64 armel armhf aarch64]
|
||||
--skip=<arch> What Architectures(s) to skip [default: None]
|
||||
-v Print docker's command output [default: False]
|
||||
|
||||
Examples:
|
||||
|
@ -27,7 +27,7 @@ THIS_DIR = os.path.dirname(os.path.abspath(__file__))
|
|||
base_vars = {
|
||||
'name': 'diginc/pi-hole',
|
||||
'maintainer' : 'adam@diginc.us',
|
||||
's6_version' : 'v1.21.2.2',
|
||||
's6_version' : 'v1.21.4.0',
|
||||
}
|
||||
|
||||
os_base_vars = {
|
||||
|
@ -43,6 +43,10 @@ images = {
|
|||
'base': 'debian:stretch',
|
||||
'arch': 'amd64'
|
||||
},
|
||||
{
|
||||
'base': 'multiarch/debian-debootstrap:armel-stretch-slim',
|
||||
'arch': 'armel'
|
||||
},
|
||||
{
|
||||
'base': 'multiarch/debian-debootstrap:armhf-stretch-slim',
|
||||
'arch': 'armhf'
|
||||
|
@ -61,13 +65,18 @@ def generate_dockerfiles(args):
|
|||
|
||||
for os, archs in images.iteritems():
|
||||
for image in archs:
|
||||
if os not in args['--os'] and image['arch'] not in args['--arch']:
|
||||
return
|
||||
if os not in args['--os'] and image['arch'] not in args['--arch'] or \
|
||||
image['arch'] in args['--skip']:
|
||||
return
|
||||
s6arch = image['arch']
|
||||
if image['arch'] == 'armel':
|
||||
s6arch = 'arm'
|
||||
merged_data = dict(
|
||||
{ 'os': os }.items() +
|
||||
base_vars.items() +
|
||||
os_base_vars[os].items() +
|
||||
image.items()
|
||||
image.items() +
|
||||
{ 's6arch': s6arch }.items()
|
||||
)
|
||||
j2_env = Environment(loader=FileSystemLoader(THIS_DIR),
|
||||
trim_blocks=True)
|
||||
|
|
|
@ -11,7 +11,7 @@ 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/{{ 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 && \
|
||||
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
|
||||
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.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 && \
|
||||
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
|
||||
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.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 && \
|
||||
apt-get install -y wget curl net-tools cron procps && \
|
||||
|
|
|
@ -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
|
||||
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.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 && \
|
||||
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):
|
||||
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):
|
||||
return request.param
|
||||
|
||||
|
|
8
tox.ini
8
tox.ini
|
@ -5,5 +5,9 @@ envlist = py27
|
|||
whitelist_externals = docker
|
||||
deps = -rrequirements.txt
|
||||
commands = docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
./Dockerfile.py -v
|
||||
pytest {posargs:-vv -n auto} ./test/
|
||||
./Dockerfile.py -v --arch amd64
|
||||
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/
|
||||
|
|
Loading…
Reference in New Issue