Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker compose on cross-platform environment

Tags:

Let's say I have a cross-platform environment,

my app is deployed twice - once on windows container and one on a Linux container,

In addition, I have a DB container (Linux).

Can I use docker compose to build those 3 services?

I think not - because the images I use are built for a certain os type.

Am I right? and maybe I am wrong and there is a workaround for this?

like image 603
Shahar Hamuzim Rajuan Avatar asked Mar 07 '17 15:03

Shahar Hamuzim Rajuan


1 Answers

Compose files using version 2.4 support the platform options, which allows for specifying the platform of the service.

platform: osx
platform: windows/amd64
platform: linux/arm64/v8

https://github.com/docker/docker.github.io/blob/master/compose/compose-file/compose-file-v2.md#platform

It should be noted that the platform option is not supported on v3 compose files.

A more in-depth explanation can be found here: https://devblogs.microsoft.com/premier-developer/mixing-windows-and-linux-containers-with-docker-compose/

like image 74
Devin Turner Avatar answered Sep 22 '22 11:09

Devin Turner