dockeraws-lambdaamazon-ecrbuildx

Create a single image with buildx for running in AWS lambda


Currently We are running a deployment script which builds an image with the usual 'docker build ...' command, pushes this image up to AWS ECR and updates the lambda function to use the new image.

Now we want to use buildx to build our images. However if i use buildx and push the resulting image to AWS ECR it pushes two artefacts, one of type "image index" and one of type "image". The problem now is that the tag i specified is set to the "image index" and lambda currently does not support this type of image.

I tried running with the '--platform linux/amd64' option as suggested here but i had no luck so far.

All i need is for buildx to generate a single image and push it to ECR just as the docker build command is doing it.

Is there anyone out there in the almighty stack overflow universe who can help me with this?


Solution

  • The issue is that BuildKit builds with the "provenance" feature enabled by default, as of v0.10. This causes a manifest to be uploaded along with the images, the same as for multi-platform builds. Provenance can be disabled by passing the flag --provenance=false.

    See this issue for more details.