-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
lambda: default architecture X86_64 isn't used for cross-platform docker builds #31048
Comments
Looks like you are trying to build a lambda docker-compatible function of X86_64 architecture from a ARM64 Mac laptop. The
Can you just specify |
Thanks for your reply.
Yes, I confirmed this works here (I didn't have any props on
Is that what you were asking about? |
Yes in your case as I presumed I'm glad this works for you. I will cut a tiny PR to improve the doc. Did I miss anything else? |
It's more of a nit, but having better fail-fast validation here would've be helpful since there are a few AWS samples still out there that have
|
Yes we need to address them with clearer doc. For this issue, I will submit a PR shortly. If you see other similar issues that deserve more clarifying or even a code fix, please raise a new issue for us. Thank you. |
Comments on closed issues and PRs are hard for our team to see. |
1 similar comment
Comments on closed issues and PRs are hard for our team to see. |
… bundling (aws#31053) ### Issue # (if applicable) Closes aws#31048 ### Reason for this change Per discussed aws#31048 (comment), the `architecture` would still be required when bundling `X86_64` DockerImageFunction from a `arm64` machine like a Macbook with arm64 chip as it explicitly pass the `--platform` argument to `docker build`, which is required in this use case. ### Description of changes ### Description of how you validated changes ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the bug
The current documented behavior for the
architecture
prop onlambda_.DockerImageFunction
is:However, I found running
cdk deploy
on my Mac would not target amd64. This results in the following error message when invoking the deployed Lambda function:I was able to resolve this by explicitly setting:
Another quirk I found was that specifying
--platform
inbuild_args
is silently ignored. You can only specify this setting via theplatform
property.Expected Behavior
lambda_.DockerImageFunction()
default architecture oflambda_.Architecture.X86_64
is passed to docker build--platform
inbuild_args
or raise an errorCurrent Behavior
The default value either seems to not be set correctly, or it's not passed correctly to docker build.
Reproduction Steps
Follow the hello world example here.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.151.0 (build b8289e2)
Framework Version
No response
Node.js Version
v20.16.0
OS
macOS
Language
Python
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: