From a19b782162120e330341dcafe5cd91d54dbea236 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Thu, 16 Jun 2022 10:35:26 +0200 Subject: [PATCH] CI: Update Docker image build scripts to support additional args --- scripts/docker/build.sh | 6 +++++- scripts/docker/buildx-multi.sh | 6 +++++- scripts/docker/buildx.sh | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/docker/build.sh b/scripts/docker/build.sh index 00b8ddb8c..6f7247ec7 100755 --- a/scripts/docker/build.sh +++ b/scripts/docker/build.sh @@ -18,7 +18,11 @@ echo "Building image 'photoprism/$1' from docker/${1/-//}$3/Dockerfile..."; if [[ $1 ]] && [[ -z $2 || $2 == "preview" ]]; then echo "Build Tags: preview" - docker build \ + if [[ $4 ]]; then + echo "Build Params: $4" + fi + + docker build $4\ --no-cache \ --build-arg BUILD_TAG=$BUILD_DATE \ -t photoprism/$1:preview \ diff --git a/scripts/docker/buildx-multi.sh b/scripts/docker/buildx-multi.sh index 981a9e7b6..289b29731 100755 --- a/scripts/docker/buildx-multi.sh +++ b/scripts/docker/buildx-multi.sh @@ -27,13 +27,17 @@ echo "Build Arch: $2" if [[ $1 ]] && [[ $2 ]] && [[ -z $3 || $3 == "preview" ]]; then echo "Build Tags: preview" + if [[ $5 ]]; then + echo "Build Params: $5" + fi + docker buildx build \ --platform $2 \ --pull \ --no-cache \ --build-arg BUILD_TAG=$BUILD_DATE \ -f docker/${1/-//}$4/Dockerfile \ - -t photoprism/$1:preview \ + -t photoprism/$1:preview $5 \ --push . elif [[ $3 =~ $NUMERIC ]]; then echo "Build Tags: $3, latest" diff --git a/scripts/docker/buildx.sh b/scripts/docker/buildx.sh index d6dc0f336..9f1dcbc3d 100755 --- a/scripts/docker/buildx.sh +++ b/scripts/docker/buildx.sh @@ -17,13 +17,17 @@ echo "Build Arch: $2" if [[ $1 ]] && [[ $2 ]] && [[ -z $3 || $3 == "preview" ]]; then echo "Build Tags: preview" + if [[ $5 ]]; then + echo "Build Params: $5" + fi + docker buildx build \ --platform $2 \ --pull \ --no-cache \ --build-arg BUILD_TAG=$BUILD_DATE \ -f docker/${1/-//}$4/Dockerfile \ - -t photoprism/$1:preview \ + -t photoprism/$1:preview $5 \ --push . elif [[ $3 =~ $NUMERIC ]]; then echo "Build Tags: $3, latest"