Closed brivu closed 1 year ago
Thanks for the suggestions @EricRibeiro! I really like the expansion at runtime. That's really slick!
However, I've tried our your suggestion but it doesn't seem to work with this command. Using ${context_args:+"$context_args"}
gives me the following error:
unknown flag: --context builder
See 'docker buildx build --help'.
I've also tried using just $context_args
in the docker buildx
command without quotations and it still doesn't like it:
error: "docker buildx build" requires exactly 1 argument.
See 'docker buildx build --help'.
I tried to do the runtime expansion with docker_tag_args
and it doesn't work as well. Interestingly though, that variable has to be unquoted for it to work.
I'm adding set +x
though. Thank you!
Your development orb has been published. It will expire in 30 days. You can preview what this will look like on the CircleCI Orb Registry at the following link: https://circleci.com/developer/orbs/orb/circleci/aws-ecr?version=dev:fe5a7db8448c601d36371254e96ba47468f89cc8
Your development orb has been published. It will expire in 30 days. You can preview what this will look like on the CircleCI Orb Registry at the following link: https://circleci.com/developer/orbs/orb/circleci/aws-ecr?version=dev:a63ea7fc95cc7231235b1a5b2312273e84341858
Hey @EricRibeiro,
After some more testing, I finally got it to work with the code below. Thanks again for your suggestions!
set -x
docker \
${context_args} \
buildx build \
-f "${ORB_EVAL_PATH}"/"${ORB_VAL_DOCKERFILE}" \
${docker_tag_args} \
--platform "${ORB_VAL_PLATFORM}" \
--progress plain \
"$@" \
"${ORB_EVAL_PATH}"
set +x
-Brian
Your development orb has been published. It will expire in 30 days. You can preview what this will look like on the CircleCI Orb Registry at the following link: https://circleci.com/developer/orbs/orb/circleci/aws-ecr?version=dev:e0ee5704fa4746ce6129c70344ced37a73dbb270
Your development orb has been published. It will expire in 30 days. You can preview what this will look like on the CircleCI Orb Registry at the following link: https://circleci.com/developer/orbs/orb/circleci/aws-ecr?version=dev:2b2d94689a35f2e963514747d86c60bd253c5dbf
This
PR
fixes theDocker Layer Caching
issue with the use ofdocker buildx
.DLC
only works when there is nodocker context
being used to build an image. This means thatDLC
will work with any platform as long as it's being built one at a time.If more than one
platform
is provided (i.e.arm64
,amd64
, etc ) , thebuilder context
will be used to support multi-architecture image builds. However,DLC
is not currently supported if more thanplatform
is provided.