From a27441d7df271a814dbb20fe8ff1f99210748f9c Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Fri, 17 Jan 2025 18:07:37 -0800 Subject: [PATCH] fix(docker): add tags for all push registries to built containers --- shell/lib/docker.sh | 10 ++++++---- shell/lib/docker_test.bats | 31 ++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/shell/lib/docker.sh b/shell/lib/docker.sh index 9af676a6..0c025a65 100644 --- a/shell/lib/docker.sh +++ b/shell/lib/docker.sh @@ -157,10 +157,12 @@ docker_buildx_args() { tags+=("$image") if [[ -n $arch ]]; then local remoteImageName - local pullRegistry - pullRegistry="$(get_docker_pull_registry)" - remoteImageName="$(determine_remote_image_name "$appName" "$pullRegistry" "$image")" - tags+=("$remoteImageName:latest-$arch" "$remoteImageName:$version-$arch") + local pushRegistries + pushRegistries="$(get_docker_push_registries)" + for pushRegistry in $pushRegistries; do + remoteImageName="$(determine_remote_image_name "$appName" "$pushRegistry" "$image")" + tags+=("$remoteImageName:latest-$arch" "$remoteImageName:$CIRCLE_TAG-$arch") + done fi fi for tag in "${tags[@]}"; do diff --git a/shell/lib/docker_test.bats b/shell/lib/docker_test.bats index 4947ec61..7923db6e 100644 --- a/shell/lib/docker_test.bats +++ b/shell/lib/docker_test.bats @@ -119,13 +119,42 @@ EOF } @test "docker_buildx_args adds tags when CIRCLE_TAG exists and arch specified" { + cat >"$BOXPATH" <"$YAML_FILE" <"$BOXPATH" <"$YAML_FILE" <