-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(lambda): lambda.DockerImageFunction
can not be used alongside containerd
to utilize cache storage backends
#31548
Comments
Hi @neilferreira , thanks for reaching out. I am able to repro the scenario with the given instructions and code. This is the error (UnsupportedImageLayerDetected) seen while deployment - ![]() Since this has a workaround, I am marking this as P2 which means it won't be immediately addressed by the team but would be in their radar. I will bring this up to the team for their input if this is something we are actively investigating and share our thoughts here if possible. Thanks. |
appreciate the replication. Yeah this seems to just be a bug on our end but given we have a known workaround I think p2 is appropriate. Keeping this in the backlog for now |
This error is pretty annoying to recover from, as well, because you have to invalidate the |
For potentially relevant context from the Docker Desktop docs:
4.34 was released in August 2024. |
Can confirm this error occurs for Docker Desktop starting v4.34.
|
Fix waiting for dependency cdklabs/cloud-assembly-schema#102 |
I had to do all the steps mentioned here and more to get my CDK lambda function to deploy. So I outlined the steps to address the common issues when pushing Docker images to Amazon Elastic Container Registry (ECR), especially for AWS CDK deployments using I also provided code examples : https://github.com/moyarich/how-to-resolve-amazon-ecr-push-issues TL;DR - Steps to Fix ECR IssuesHere's the summary: Common Errors Addressed
Steps to Resolve ECR Issues
{
"scripts": {
"deploy": "DOCKER_BUILDKIT=1 sh -c 'cd my_cdk_stacks && npm run cdk deploy -- -c stack_name=\"${STACK_NAME:-}\" --all --require-approval never'",
"predeploy": "aws ecr get-login-password | docker login --username AWS --password-stdin $(aws sts get-caller-identity --query 'Account' --output text).dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com",
"destroy": "cd my_cdk_stacks && npm run cdk destroy -- -c stack_name=\"${STACK_NAME:-}\" --all"
}
} |
Hey there, I had this issue as well, my specs:
Followed the steps for the workaround described in this thread which did get my CDK deploy working again, thanks to all who contributed to that. However, the workaround is a bit of lengthy process so would be great if CDK Dev teams were able to bump this issue to P1 and patch asap (: I understand you guys probably have a million things to do, and this seems to be a somewhat uncommon problem, but would love to see a patch sooner rather than later. Thanks all! |
I found the following workaround for me (Mac Mini m4, Sequoia 15.3, Docker Desktop version = v4.38.0, cdk 2.177.0).
No CDK code change |
Describe the bug
Context:
CDK provides the ability to utilize Docker cache storage backends as per the docs.
In order to make use of cache storage backends such as a local directory or external registry, it is a requirement to enable containerd image store in Docker.
Once containerd has been enabled, you are able to populate the build cache parameters within CDK, and subsequent builds on different CI runners would all utilise the same backend cache, drastically improving the CDK build and deployment process.
Bug
Once
containerd
has been enabled, any Lambda function utilizing the Docker runtime fails to deploy.Lambda code:
Errror message:
A likely resolution:
As per a similar issue noted on #30258 - The only workaround for this is to currently use
BUILDX_NO_DEFAULT_ATTESTATIONS=1 cdk deploy
It would be better if CDK explicitly adds
--provenance=false
in its calls to docker buildx, or provides the ability to do so.See https://docs.docker.com/reference/cli/docker/buildx/build/#provenance and https://docs.docker.com/build/attestations/attestation-storage/
Regression Issue
Last Known Working CDK Version
n/a
Expected Behavior
I would expect to be able to utilize the documented cache backends feature within CDK when deploying Lambda functions that utilises a container image. These two CDK features are not able to work together.
Current Behavior
Lambda fails to create or update the Lambda function with the following error message:
Reproduction Steps
Run
cdk deploy
to deploy the function.Possible Solution
Prefixing
BUILDX_NO_DEFAULT_ATTESTATIONS=1
tocdk deploy
works around this issue.Additional Information/Context
No response
CDK CLI Version
2.160.0 (build 7a8ae02)
Framework Version
No response
Node.js Version
v18.17.1
OS
MacOS 14.6
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: