Hello all. I use the aws-ecr@8.2.1 orb, specifically the build-and-push-image job to send Docker images to a private repository in the AWS ECR. When looking at my repository, I noticed that each execution of the build-and-push-image job has resulted in three artifacts in the repository, two that same size and one that is 0 bytes. Each artifact has a different digest.
When I call the job from within one of my own, the job parameters are similar to this:
While the source code is available for the ORB, one major limitation is that the command: that executes the shell script for build-and-push-image is just a single 3,500+ character line, so making it a little hard to see what is going on.
Within the executed script the ādocker buildx buildā command is used and the output you are listing is coming from that command. So the exporting steps are just part of the local process of creating the image that you want to be built and pushed to AWS.
Experiencing the same. Added concern is that this is then interpreted as a multi-platform image by AWS, and multi-platform images are not supported by Lambda, making the aws-ecr orb useless for publishing Lambda images for Docker. Not sure how to work around this⦠am I missing something?
I concluded similar as well, as far as multi-platform building goes. I think I can work around it for now, but I am unsure if those un-tagged artifacts are of any concern. It appears that the artifact marked as āImage Indexā in the ECR is what Iām most interested in as it is what is retagged with the aws-ecr/tag-image job.
Thanks for getting me to look at the aws-ecr/tag-image job! I was going to see if I could use it as a starting point for tagging the image I actually want tagged instead. But, when I ran this cli, it shows some more details about this 0-sized āimageā. It is the attestation manifest. (and size isnāt 0, itās 566 bytes, in my case).
This leads to a simple solution! We can avoid creating this attestation by adding extra-build-args: --provenance=false to the aws-ecr/build-and-push-image job.