-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(assets): allow user to pass platform option to Docker builds #12472
Copy link
Copy link
Closed
Labels
@aws-cdk/assetsRelated to the @aws-cdk/assets packageRelated to the @aws-cdk/assets packageeffort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.feature/enhancementA new API to make things easier or more intuitive. A catch-all for general feature requests.A new API to make things easier or more intuitive. A catch-all for general feature requests.p1
Metadata
Metadata
Assignees
Labels
@aws-cdk/assetsRelated to the @aws-cdk/assets packageRelated to the @aws-cdk/assets packageeffort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.feature/enhancementA new API to make things easier or more intuitive. A catch-all for general feature requests.A new API to make things easier or more intuitive. A catch-all for general feature requests.p1
Use Case
To be able to build images for
amd64architecture (e.g. AWS Fargate) on a system that is using other architecture likearm64(e.g. Apple M1).Proposed Solution
Replace
docker buildwithdocker buildx build.https://docs.docker.com/buildx/working-with-buildx/#build-multi-platform-images
With
buildxyou can build cross-platform images by declaring--platformargument. e.g.docker buildx build --platform linux/amd64 someimage:sometag .executed on system Apple M1 results in an image which works system withamd64architecture.buildxallows you also to build image for multiple platforms at once. e.g.--platform linux/amd64,linux/arm64Other
Currently image
.fromAssetresults in an image that works only on the same architecture where it was built. In that sense, this could be considered also a bug – the image built doesn't work on the target system (Fargate).This is a 🚀 Feature Request