-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Use Case
To be able to build images for amd64 architecture (e.g. AWS Fargate) on a system that is using other architecture like arm64 (e.g. Apple M1).
Proposed Solution
Replace docker build with docker buildx build.
https://docs.docker.com/buildx/working-with-buildx/#build-multi-platform-images
With buildx you can build cross-platform images by declaring --platform argument. e.g. docker buildx build --platform linux/amd64 someimage:sometag . executed on system Apple M1 results in an image which works system with amd64 architecture.
buildx allows you also to build image for multiple platforms at once. e.g. --platform linux/amd64,linux/arm64
Other
Currently image .fromAsset results 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).
import { FargateTaskDefinition, ContainerImage } from '@aws-cdk/aws-ecs';
const taskDefinition = new FargateTaskDefinition(this, 'TaskDefinition');
taskDefinition
.addContainer('Container', {
image: ContainerImage.fromAsset(path.resolve(__dirname, '../image')),
});- 👋 I may be able to implement this feature request
-
⚠️ This feature might incur a breaking change
This is a 🚀 Feature Request