Docker compose run with specified platform

Viewed 4027

my docker script has this line.

docker-compose --file "$COMPOSE_FILE" up --detach --build --force-recreate

I would like to run it for specific platform, for example --platform=linux/amd64

How can I include the platform where it should run?

1 Answers

In the compose file, within your service, you would set:

platform: "linux/amd64"

This is available in both the latest compose spec and version 2 of the compose file.

Related