mirror of
https://github.com/pi-hole/docker-pi-hole.git
synced 2025-12-20 02:18:51 +00:00
Add PADD branch switch to build script. Fix casing of as->AS in Dockerfile to silence a warning about casing
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
7
build.sh
7
build.sh
@@ -7,6 +7,7 @@ usage() {
|
||||
echo " -f, --ftlbranch <branch> Specify FTL branch (cannot be used in conjunction with -l)"
|
||||
echo " -c, --corebranch <branch> Specify Core branch"
|
||||
echo " -w, --webbranch <branch> Specify Web branch"
|
||||
echo " -p, --paddbranch <branch> Specify PADD branch"
|
||||
echo " -t, --tag <tag> Specify Docker image tag (default: pihole)"
|
||||
echo " -l, --local Use locally built FTL binary (requires src/pihole-FTL file)"
|
||||
echo " use_cache Enable caching (by default --no-cache is used)"
|
||||
@@ -61,6 +62,12 @@ while [[ $# -gt 0 ]]; do
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-p | --paddbranch)
|
||||
PADD_BRANCH="$2"
|
||||
DOCKER_BUILD_CMD+=" --build-arg PADD_BRANCH=$PADD_BRANCH"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-t | --tag)
|
||||
TAG="$2"
|
||||
DOCKER_BUILD_CMD=${DOCKER_BUILD_CMD/pihole/$TAG}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
ARG FTL_SOURCE=remote
|
||||
ARG alpine_version="3.19"
|
||||
FROM alpine:${alpine_version} as base
|
||||
FROM alpine:${alpine_version} AS base
|
||||
# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
@@ -69,7 +69,7 @@ COPY --chmod=0755 start.sh /usr/bin/start.sh
|
||||
|
||||
## Buildkit can do some fancy stuff and we can use it to either download FTL from ftl.pi-hole.net or use a local copy
|
||||
|
||||
FROM base as remote-ftl-install
|
||||
FROM base AS remote-ftl-install
|
||||
# Default stage if FTL_SOURCE is not explicitly set to "local"
|
||||
# Download the latest version of pihole-FTL for the correct architecture
|
||||
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then FTLARCH=amd64; \
|
||||
@@ -85,12 +85,12 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then FTLARCH=amd64; \
|
||||
&& chmod +x /usr/bin/pihole-FTL \
|
||||
&& readelf -h /usr/bin/pihole-FTL || cat /usr/bin/pihole-FTL
|
||||
|
||||
FROM base as local-ftl-install
|
||||
FROM base AS local-ftl-install
|
||||
# pihole-FTL must be built from source and copied to the build directory first!
|
||||
COPY --chmod=0755 pihole-FTL /usr/bin/pihole-FTL
|
||||
|
||||
# Use the appropriate FTL Install stage based on the FTL_SOURCE build-arg
|
||||
FROM ${FTL_SOURCE}-ftl-install as final
|
||||
FROM ${FTL_SOURCE}-ftl-install AS final
|
||||
|
||||
HEALTHCHECK CMD dig +short +norecurse +retry=0 @127.0.0.1 pi.hole || exit 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user