Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker-compose multi arch

Docker images can be built for multi architectures. This is usually done by creating a specific image per architecture, and then creating manifest as a proxy to the right image depending on the system that pulls the image.

That's great.

Now, with docker-compose, it's also possible to build images, but I don't see a way to build the image depending on the architecture, so it seems like the only way to have a single docker-compose definition for multiple architectures, is to have pushed multi-arch images to a registry and pull from there.

Does anyone know of a way to build local images for the right arch with the docker-compose build step?

like image 780
MrE Avatar asked Jul 31 '19 17:07

MrE


Video Answer


1 Answers

I don't think you can use docker-compose build, but you could use docker buildx bake to build multi-arch using a docker-compose.yml.

docker buildx bake --push --set *.platform=linux/amd64,linux/arm64`

You'll probably want to read more about docker buildx bake and building multi-platform images.

like image 93
Jack Miner Ewes Avatar answered Sep 18 '22 23:09

Jack Miner Ewes