Skip to content

Commit 094d879

Browse files
fix: do not recreate builder if exists (#388)
1 parent 0e14834 commit 094d879

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/scripts/docker_buildx.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ if [ "${AWS_ECR_BOOL_SKIP_WHEN_TAGS_EXIST}" -eq "0" ] || [[ "${AWS_ECR_BOOL_SKIP
8080
# otherwise the command will fail when called more than once in the same job.
8181
docker context create builder
8282
docker run --privileged --rm "tonistiigi/binfmt:$PARAM_BINFMT_VERSION" --install all
83-
docker --context builder buildx create --name DLC_builder --use
83+
builder_exists="$(docker --context builder buildx ls --format json | jq -s 'any(.[]; .Name == "DLC_builder")')"
84+
if [ "${builder_exists}" != "true" ]; then
85+
docker --context builder buildx create --name DLC_builder --use
86+
fi
8487
fi
8588
context_args="--context builder"
8689
# if no builder instance is currently used, create one

0 commit comments

Comments
 (0)