From 926b3ae8c6bf876532ea7685d1dea21eecac1755 Mon Sep 17 00:00:00 2001 From: edgd1er Date: Sun, 23 Jul 2023 19:45:25 +0200 Subject: [PATCH] fix arm64 arch. use copy --chmod --- src/Dockerfile | 56 ++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/src/Dockerfile b/src/Dockerfile index f8a119e7a..d9e76ef16 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -1,7 +1,15 @@ ARG CONTAINER="3.18" FROM alpine:${CONTAINER} # https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope + ARG TARGETPLATFORM +ARG WEB_BRANCH="development-v6" +ARG CORE_BRANCH="development-v6" +ARG FTL_BRANCH="development-v6" + +ENV TZ=Europe/Paris +ENV DNSMASQ_USER=pihole +ENV FTL_CMD=no-daemon RUN apk add --no-cache \ git \ @@ -18,34 +26,30 @@ RUN apk add --no-cache \ jq \ coreutils \ procps \ - ncurses + ncurses \ + binutils ARG PIHOLE_DOCKER_TAG="unknown" RUN echo "${PIHOLE_DOCKER_TAG}" > /pihole.docker.tag - -ARG WEB_BRANCH="development-v6" -ARG CORE_BRANCH="development-v6" -ARG FTL_BRANCH="development-v6" +ADD https://ftl.pi-hole.net/macvendor.db /macvendor.db +COPY crontab.txt /crontab.txt # download a the main repos from github -RUN git clone --depth 1 --single-branch --branch ${WEB_BRANCH} https://github.com/pi-hole/AdminLTE.git /var/www/html/admin && \ - git clone --depth 1 --single-branch --branch ${CORE_BRANCH} https://github.com/pi-hole/pi-hole.git /etc/.pihole - -# Download the latest version of pihole-FTL for alpine: -# Probably need this to be built for different FTLARCHs -RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then FTLARCH=amd64; \ +RUN git clone --depth 1 --single-branch --branch development-v6 https://github.com/pi-hole/AdminLTE.git /var/www/html/admin && \ + git clone --depth 1 --single-branch --branch development-v6 https://github.com/pi-hole/pi-hole.git /etc/.pihole ;\ + # Download the latest version of pihole-FTL for alpine: + # Probably need this to be built for different FTLARCHs + if [ "$TARGETPLATFORM" = "linux/amd64" ]; then FTLARCH=amd64; \ elif [ "$TARGETPLATFORM" = "linux/386" ]; then FTLARCH=386; \ elif [ "$TARGETPLATFORM" = "linux/arm/v6" ]; then FTLARCH=armv6; \ elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then FTLARCH=armv7; \ - elif [ "$TARGETPLATFORM" = "linux/arm64/v8" ]; then FTLARCH=armv64; \ + elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then FTLARCH=arm64; \ elif [ "$TARGETPLATFORM" = "linux/riscv64" ]; then FTLARCH=riscv64; \ else FTLARCH=amd64; fi \ - && curl -sSL "https://ftl.pi-hole.net/${FTL_BRANCH}/pihole-FTL-${FTLARCH}" -o /usr/bin/pihole-FTL && \ - chmod +x /usr/bin/pihole-FTL - - -ADD https://ftl.pi-hole.net/macvendor.db /macvendor.db -COPY crontab.txt /crontab.txt + && echo "Arch: ${TARGETPLATFORM}, FTLARCH: ${FTLARCH}" \ + && curl -sSL "https://ftl.pi-hole.net/${FTL_BRANCH}/pihole-FTL-${FTLARCH}" -o /usr/bin/pihole-FTL \ + && chmod +x /usr/bin/pihole-FTL \ + && readelf -h /usr/bin/pihole-FTL || cat /usr/bin/pihole-FTL RUN cd /etc/.pihole && \ install -Dm755 -d /opt/pihole && \ @@ -56,18 +60,12 @@ RUN cd /etc/.pihole && \ install -Dm755 -t /usr/local/bin pihole && \ install -Dm644 ./advanced/bash-completion/pihole /etc/bash_completion.d/pihole && \ install -T -m 0755 ./advanced/Templates/pihole-FTL-prestart.sh /opt/pihole/pihole-FTL-prestart.sh && \ - install -T -m 0755 ./advanced/Templates/pihole-FTL-poststop.sh /opt/pihole/pihole-FTL-poststop.sh - - -ENV DNSMASQ_USER=pihole -ENV FTL_CMD=no-daemon -RUN addgroup -S pihole && adduser -S pihole -G pihole -# RUN groupadd pihole && useradd -r --no-user-group -g pihole -s /usr/sbin/nologin pihole - -COPY bash_functions.sh /usr/bin/bash_functions.sh -COPY start.sh /usr/bin/start.sh + install -T -m 0755 ./advanced/Templates/pihole-FTL-poststop.sh /opt/pihole/pihole-FTL-poststop.sh && \ + # RUN groupadd pihole && useradd -r --no-user-group -g pihole -s /usr/sbin/nologin pihole + addgroup -S pihole && adduser -S pihole -G pihole -RUN chmod +x /usr/bin/start.sh +COPY --chmod=0755 bash_functions.sh /usr/bin/bash_functions.sh +COPY --chmod=0755 start.sh /usr/bin/start.sh HEALTHCHECK CMD dig +short +norecurse +retry=0 @127.0.0.1 pi.hole || exit 1