Bob
Bob

Reputation: 8714

Docker compose run with specified platform

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?

Upvotes: 13

Views: 16668

Answers (1)

BMitch
BMitch

Reputation: 264701

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.

Upvotes: 33

Related Questions