Reputation: 451
I try to deploy container image to lambda function, but this error message appear
The image manifest or layer media type for the source image <image_source> is not supported.
here is my Dockerfile, i believe i have use the proper setup
FROM public.ecr.aws/lambda/python:3.8
# Install dependencies
COPY requirements.txt ./
RUN pip install -r requirements.txt
# Copy function code
COPY app/* ./
# Set the CMD to your handler
CMD [ "lambda_function.lambda_handler" ]
Upvotes: 26
Views: 11161
Reputation: 1
Ran into the same issue on an Apple Silicon MacBook. Pass both --platform linux/amd64
and --provenance=false
.
Upvotes: 0
Reputation: 671
I fought with this for hours. Finally pieced together a couple of key elements from other threads... On my Silicon process Macbook, I was ONLY able to get this to work by passing BOTH the --platform and --provenance switches to the docker build command.
You'll need to replace "lambda-images" in this command with the name of your repository and be sure to replace "us-east-2" with the region you are using.
Example command:
docker build -f Dockerfile \
--platform linux/amd64 \
--provenance=false \
-t 1234567890.dkr.ecr.us-east-2.amazonaws.com/lambda-images:latest \
.
Upvotes: 0
Reputation: 111
I encountered the same problem, building a linux/amd64 image following the official AWS tutorial.
I finally succeeded to create a (working) lambda function using the one of the 3 images published in the ECR repro : not the one with the tag mentionned in the "docker push" command, not the one with size 0 but the 3rd one using its hash tag.
I don't know why the "docker push" command generate 3 images in the ECR repo ! and why the image tagged in the "docker push" command is not working...
Upvotes: 11
Reputation: 511
If you are using buildx >= 0.10 specifying target platform does not work since it also creates multi-platform index by default.
To fix this problem set --provenance=false
to docker build.
For more details please see: https://github.com/docker/buildx/issues/1509#issuecomment-1378538197
Upvotes: 40
Reputation: 81
Try by specifying the target platform of the image you build as amd64
:
docker build --platform linux/amd64 . -t my_image
.
I get the same error while trying to deploy a lambda based on an image that supports both linux/amd64
and linux/arm64/v8
(Apple Silicon) architectures.
Upvotes: 8