From 4808b9fe8d7ad5715f25c9b6b1ee86e7ac38fe60 Mon Sep 17 00:00:00 2001 From: Adam Hill Date: Wed, 15 Jul 2020 16:48:50 -0500 Subject: [PATCH 1/8] v5.1 Signed-off-by: Adam Hill --- Dockerfile_amd64 | 4 ++-- VERSION | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile_amd64 b/Dockerfile_amd64 index 121adde..e7d39a6 100644 --- a/Dockerfile_amd64 +++ b/Dockerfile_amd64 @@ -37,10 +37,10 @@ ENV ServerIP 0.0.0.0 ENV FTL_CMD no-daemon ENV DNSMASQ_USER root -ENV VERSION v5.0 +ENV VERSION v5.1 ENV PATH /opt/pihole:${PATH} -LABEL image="pihole/pihole:v5.0_amd64" +LABEL image="pihole/pihole:v5.1_amd64" LABEL maintainer="adam@diginc.us" LABEL url="https://www.github.com/pi-hole/docker-pi-hole" diff --git a/VERSION b/VERSION index 5e0a0f1..ad24aea 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v5.0 +v5.1 From d49eebc25de4e1813eb99bfc64d6bb29dd03cb9f Mon Sep 17 00:00:00 2001 From: Adam Hill Date: Wed, 15 Jul 2020 17:04:47 -0500 Subject: [PATCH 2/8] fix pip in outer build container, commit templating Signed-off-by: Adam Hill --- Dockerfile_arm64 | 4 ++-- Dockerfile_armel | 4 ++-- Dockerfile_armhf | 4 ++-- Dockerfile_build | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile_arm64 b/Dockerfile_arm64 index c3f6ad4..3b17b84 100644 --- a/Dockerfile_arm64 +++ b/Dockerfile_arm64 @@ -37,10 +37,10 @@ ENV ServerIP 0.0.0.0 ENV FTL_CMD no-daemon ENV DNSMASQ_USER root -ENV VERSION v5.0 +ENV VERSION v5.1 ENV PATH /opt/pihole:${PATH} -LABEL image="pihole/pihole:v5.0_arm64" +LABEL image="pihole/pihole:v5.1_arm64" LABEL maintainer="adam@diginc.us" LABEL url="https://www.github.com/pi-hole/docker-pi-hole" diff --git a/Dockerfile_armel b/Dockerfile_armel index dc35b3a..f581a60 100644 --- a/Dockerfile_armel +++ b/Dockerfile_armel @@ -37,10 +37,10 @@ ENV ServerIP 0.0.0.0 ENV FTL_CMD no-daemon ENV DNSMASQ_USER root -ENV VERSION v5.0 +ENV VERSION v5.1 ENV PATH /opt/pihole:${PATH} -LABEL image="pihole/pihole:v5.0_armel" +LABEL image="pihole/pihole:v5.1_armel" LABEL maintainer="adam@diginc.us" LABEL url="https://www.github.com/pi-hole/docker-pi-hole" diff --git a/Dockerfile_armhf b/Dockerfile_armhf index 1862462..ea0474a 100644 --- a/Dockerfile_armhf +++ b/Dockerfile_armhf @@ -37,10 +37,10 @@ ENV ServerIP 0.0.0.0 ENV FTL_CMD no-daemon ENV DNSMASQ_USER root -ENV VERSION v5.0 +ENV VERSION v5.1 ENV PATH /opt/pihole:${PATH} -LABEL image="pihole/pihole:v5.0_armhf" +LABEL image="pihole/pihole:v5.1_armhf" LABEL maintainer="adam@diginc.us" LABEL url="https://www.github.com/pi-hole/docker-pi-hole" diff --git a/Dockerfile_build b/Dockerfile_build index 550a050..4388f5a 100644 --- a/Dockerfile_build +++ b/Dockerfile_build @@ -5,7 +5,7 @@ ARG packages RUN apk --update add python3 python3-dev curl gcc make \ musl-dev libffi-dev openssl-dev ${packages} \ && rm -rf /var/cache/apk/* \ - && pip3 install -U pip pipenv + && python3 -m pip install -U pip pipenv # -v "$(pwd):/$(pwd)" -w "$(pwd)" to prevent nested docker path confusion From bb8a8aeedd53d7825b4f52b2d963cbe91773ab7b Mon Sep 17 00:00:00 2001 From: Adam Hill Date: Wed, 15 Jul 2020 17:15:35 -0500 Subject: [PATCH 3/8] fix pip Signed-off-by: Adam Hill --- Dockerfile_build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile_build b/Dockerfile_build index 4388f5a..f487e66 100644 --- a/Dockerfile_build +++ b/Dockerfile_build @@ -2,7 +2,7 @@ FROM docker:latest # Based on https://github.com/Ilhicas/alpine-pipenv ARG packages -RUN apk --update add python3 python3-dev curl gcc make \ +RUN apk --update add python3 python3-dev py3-pip curl gcc make \ musl-dev libffi-dev openssl-dev ${packages} \ && rm -rf /var/cache/apk/* \ && python3 -m pip install -U pip pipenv From b50e94e22d480a0c1bd72026633ac8fbb451a27b Mon Sep 17 00:00:00 2001 From: Adam Hill Date: Wed, 15 Jul 2020 17:41:12 -0500 Subject: [PATCH 4/8] revert Signed-off-by: Adam Hill --- Dockerfile_build | 4 ++-- circle-test.sh | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile_build b/Dockerfile_build index f487e66..550a050 100644 --- a/Dockerfile_build +++ b/Dockerfile_build @@ -2,10 +2,10 @@ FROM docker:latest # Based on https://github.com/Ilhicas/alpine-pipenv ARG packages -RUN apk --update add python3 python3-dev py3-pip curl gcc make \ +RUN apk --update add python3 python3-dev curl gcc make \ musl-dev libffi-dev openssl-dev ${packages} \ && rm -rf /var/cache/apk/* \ - && python3 -m pip install -U pip pipenv + && pip3 install -U pip pipenv # -v "$(pwd):/$(pwd)" -w "$(pwd)" to prevent nested docker path confusion diff --git a/circle-test.sh b/circle-test.sh index e0a8b93..e05af78 100755 --- a/circle-test.sh +++ b/circle-test.sh @@ -12,6 +12,7 @@ if [[ "$1" == "enter" ]]; then fi # generate and build dockerfile +docker pull docker:latest docker build -t image_pipenv -f Dockerfile_build . env > /tmp/env docker run --rm \ From 0958583bf29914c228b8f30b121f3eeb0fc72db1 Mon Sep 17 00:00:00 2001 From: Adam Hill Date: Wed, 27 May 2020 19:26:53 -0500 Subject: [PATCH 5/8] debian, our one true savior from bad docker build base images Signed-off-by: Adam Hill --- Dockerfile_build | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile_build b/Dockerfile_build index 550a050..fdf3c4c 100644 --- a/Dockerfile_build +++ b/Dockerfile_build @@ -1,10 +1,13 @@ -FROM docker:latest +FROM python:buster + +# Only works for docker CLIENT (bind mounted socket) +COPY --from=docker:18.09.3 /usr/local/bin/docker /usr/local/bin/ # Based on https://github.com/Ilhicas/alpine-pipenv ARG packages -RUN apk --update add python3 python3-dev curl gcc make \ - musl-dev libffi-dev openssl-dev ${packages} \ - && rm -rf /var/cache/apk/* \ +RUN apt-get update && \ + apt-get install -y python3-dev curl gcc make \ + libffi-dev libssl-dev ${packages} \ && pip3 install -U pip pipenv @@ -14,7 +17,7 @@ COPY Pipfile* /root/ WORKDIR /root RUN pipenv install --system \ - && sed -i 's|/bin/sh|/bin/bash|g' /usr/lib/python3.8/site-packages/testinfra/backend/docker.py + && sed -i 's|/bin/sh|/bin/bash|g' /usr/local/lib/python3.8/site-packages/testinfra/backend/docker.py RUN echo "set -ex && Dockerfile.sh && \$@" > /usr/local/bin/entrypoint.sh From 1b4677b5edc78da81fdc739ae477ba810c07212e Mon Sep 17 00:00:00 2001 From: Adam Hill Date: Wed, 15 Jul 2020 17:42:24 -0500 Subject: [PATCH 6/8] pull base image Signed-off-by: Adam Hill --- circle-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle-test.sh b/circle-test.sh index e05af78..f3ce7fe 100755 --- a/circle-test.sh +++ b/circle-test.sh @@ -12,7 +12,7 @@ if [[ "$1" == "enter" ]]; then fi # generate and build dockerfile -docker pull docker:latest +docker pull python:buster docker build -t image_pipenv -f Dockerfile_build . env > /tmp/env docker run --rm \ From 0b2c4642dfbdbcf89b3ab6da581991a45e954058 Mon Sep 17 00:00:00 2001 From: Adam Hill Date: Wed, 15 Jul 2020 18:17:33 -0500 Subject: [PATCH 7/8] v5.1.1 Signed-off-by: Adam Hill --- Dockerfile_amd64 | 4 ++-- Dockerfile_arm64 | 4 ++-- Dockerfile_armel | 4 ++-- Dockerfile_armhf | 4 ++-- VERSION | 2 +- install.sh | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile_amd64 b/Dockerfile_amd64 index e7d39a6..f2f1532 100644 --- a/Dockerfile_amd64 +++ b/Dockerfile_amd64 @@ -37,10 +37,10 @@ ENV ServerIP 0.0.0.0 ENV FTL_CMD no-daemon ENV DNSMASQ_USER root -ENV VERSION v5.1 +ENV VERSION v5.1.1 ENV PATH /opt/pihole:${PATH} -LABEL image="pihole/pihole:v5.1_amd64" +LABEL image="pihole/pihole:v5.1.1_amd64" LABEL maintainer="adam@diginc.us" LABEL url="https://www.github.com/pi-hole/docker-pi-hole" diff --git a/Dockerfile_arm64 b/Dockerfile_arm64 index 3b17b84..dd7a66c 100644 --- a/Dockerfile_arm64 +++ b/Dockerfile_arm64 @@ -37,10 +37,10 @@ ENV ServerIP 0.0.0.0 ENV FTL_CMD no-daemon ENV DNSMASQ_USER root -ENV VERSION v5.1 +ENV VERSION v5.1.1 ENV PATH /opt/pihole:${PATH} -LABEL image="pihole/pihole:v5.1_arm64" +LABEL image="pihole/pihole:v5.1.1_arm64" LABEL maintainer="adam@diginc.us" LABEL url="https://www.github.com/pi-hole/docker-pi-hole" diff --git a/Dockerfile_armel b/Dockerfile_armel index f581a60..687f964 100644 --- a/Dockerfile_armel +++ b/Dockerfile_armel @@ -37,10 +37,10 @@ ENV ServerIP 0.0.0.0 ENV FTL_CMD no-daemon ENV DNSMASQ_USER root -ENV VERSION v5.1 +ENV VERSION v5.1.1 ENV PATH /opt/pihole:${PATH} -LABEL image="pihole/pihole:v5.1_armel" +LABEL image="pihole/pihole:v5.1.1_armel" LABEL maintainer="adam@diginc.us" LABEL url="https://www.github.com/pi-hole/docker-pi-hole" diff --git a/Dockerfile_armhf b/Dockerfile_armhf index ea0474a..e626156 100644 --- a/Dockerfile_armhf +++ b/Dockerfile_armhf @@ -37,10 +37,10 @@ ENV ServerIP 0.0.0.0 ENV FTL_CMD no-daemon ENV DNSMASQ_USER root -ENV VERSION v5.1 +ENV VERSION v5.1.1 ENV PATH /opt/pihole:${PATH} -LABEL image="pihole/pihole:v5.1_armhf" +LABEL image="pihole/pihole:v5.1.1_armhf" LABEL maintainer="adam@diginc.us" LABEL url="https://www.github.com/pi-hole/docker-pi-hole" diff --git a/VERSION b/VERSION index ad24aea..346d9ca 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v5.1 +v5.1.1 diff --git a/install.sh b/install.sh index 2df2275..072539e 100644 --- a/install.sh +++ b/install.sh @@ -4,7 +4,7 @@ mkdir -p /etc/pihole/ mkdir -p /var/run/pihole # Production tags with valid web footers export CORE_VERSION="$(cat /etc/docker-pi-hole-version)" -export WEB_VERSION="${CORE_VERSION}" +export WEB_VERSION="v5.1" # Only use for pre-production / testing export CHECKOUT_BRANCHES=false From 562b6c1d5a4f0730ffea10e2733783785c58e3f9 Mon Sep 17 00:00:00 2001 From: Adam Hill Date: Wed, 15 Jul 2020 18:42:29 -0500 Subject: [PATCH 8/8] Dockerfile.py aborts on error now, workaround whiptail not being wrapped by unattended Signed-off-by: Adam Hill --- Dockerfile.py | 3 ++- Dockerfile.sh | 5 +++-- install.sh | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile.py b/Dockerfile.py index 0aa1e1b..0db8d92 100755 --- a/Dockerfile.py +++ b/Dockerfile.py @@ -112,8 +112,9 @@ def run_and_stream_command_output(command, args): print(line, end='') build_result.wait() if build_result.returncode != 0: - print(" ::: Error running".format(command)) + print(" ::: Error running {}".format(command)) print(build_result.stderr) + sys.exit(build_resuilt.returncode) def build(docker_repo, arch, args): diff --git a/Dockerfile.sh b/Dockerfile.sh index e48a64f..1446b0f 100755 --- a/Dockerfile.sh +++ b/Dockerfile.sh @@ -1,8 +1,9 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash + # alpine sh only set -eux -./Dockerfile.py -v --arch="${ARCH}" --hub_tag="${ARCH_IMAGE}" +./Dockerfile.py -v --no-cache --arch="${ARCH}" --hub_tag="${ARCH_IMAGE}" # TODO: Add junitxml output and have circleci consume it # 2 parallel max b/c race condition with docker fixture (I think?) py.test -vv -n 2 -k "${ARCH}" ./test/ diff --git a/install.sh b/install.sh index 072539e..3de2723 100644 --- a/install.sh +++ b/install.sh @@ -15,6 +15,7 @@ fi apt-get update apt-get install --no-install-recommends -y curl procps ca-certificates +ln -s `which echo` /usr/local/bin/whiptail curl -L -s $S6OVERLAY_RELEASE | tar xvzf - -C / mv /init /s6-init