-
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
DockerImageCode: docker build fails on Apple silicon #33522
Comments
Generally, I would recommend bundling on a x86 environment or pipeline if you are deploying to a x86 runtime. I have been using this to make sure the lambda architecture will be consistent with my bundling platform. const handler = new lambda.DockerImageFunction(this, 'Func', {
code: lambda.DockerImageCode.fromImageAsset(local_path, {
file: 'Dockerfile'
}),
architecture: os.arch() === 'arm64' ? lambda.Architecture.ARM_64 : undefined,
}); |
This did not fix the issue - I suspect it is something wrong with Apple Silicon in particular? |
I am also experiencing this. I am deploying ARM on ARM so I don't know why this would occur. EDIT: In my case this was due to the image not being built at all (even though it looked like it had been built). And therefore, the layers were invalid because there were no layers and it couldn't be uploaded. |
The code that I initially had the bug on was extremely complex and heavy, with around 450MB in the One important thing to note is that online, many people have detailed the many settings that one has to change in order to deploy from an Apple Silicon Macbook without issue, but in a separate branch, I pretty much removed all of these, only to have: const exampleLambda = new DockerImageFunction(this, 'exampleLambda', {
code: DockerImageCode.fromImageAsset('docker'),
}); and the deployment still worked flawlessly. HERE is the repo. and HERE is the branch without any options. I have moved on to using a different architecture for my project that doesn't involve Docker Lambda functions, but when free I will try to make any changes to see if the bug can be reproduced, and will update this thread. |
Describe the bug
The following code:
works randomly about 1/5 of the time on my macbook, but seems to work reliably on an ubuntu x86 VM.
The error is regarding how one specific layer cannot be pushed, and how lambda can't use it since it hasn't stabilized yet.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
Expected to build my docker from the Dockerfile and deploy with no errors.
Current Behavior
On Apple Silicon there seems to be an error.
First time:
After the first time:
Reproduction Steps
Create a CDK with a Lambda Function that uses
DockerImageFunction
that usesDockerImageCode
on Apple Silicon and try deploying it.Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.173.2
Framework Version
No response
Node.js Version
22.0.0
OS
OSX 15.3.1
Language
TypeScript
Language Version
TypeScript (5.6.3)
Other information
No response
The text was updated successfully, but these errors were encountered: