-
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
CodeBuild: Cannot create Arm64 CodeBuild image in CDK running on Amd64 #28863
Comments
To build ARM images with CodeBuild, generally you have two options: Option 1
Option 2Using buildx as described here, which is a little bit tricky. I would recommend option 1 in your case. The |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
LinuxArmBuildImage does not have a FromAsset method. Shouldn't my code work as is? Otherwise why have platform as a property? It's smart enough to pass the correct --platform operator in the docker command so is it a problem with the build image CDK is using? This build image claims to be compatible with the --platform parameter, doesn't it? |
Looking at the fromAsset() implementation, you will need to create DockerImageAsset by passing relevant props before you can create the LinuxBuildImage. aws-cdk/packages/aws-cdk-lib/aws-codebuild/lib/project.ts Lines 1892 to 1899 in c5eca1a
|
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Describe the bug
We are migrating from x86 to ARM and replicated our custom x86 CodeBuild Asset, configuring it to arm64. On deploying CDK the Arm64 image generates an error.
Expected Behavior
The
--platform linux/arm64
flag should be respected and create the Asset successfullyCurrent Behavior
When this is built in the Docker Assets section of the pipeline it passes the correct
--platform
flag but errors withexec format error
:Reproduction Steps
https://github.com/m17kea/cdk-arm
I've also included another branch
arm
which reverses the problem, building amd64 on arm build images which fails in the same way.Possible Solution
Use docker buildx
Additional Information/Context
No response
CDK CLI Version
2.123.0 (build a594112)
Framework Version
No response
Node.js Version
v18.17.1
OS
Mac OS Sonoma 14.2.1
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: