Is it possible to set --platform flag for docker tasks?


Currently I’m running some of my containers using --platform flag.

docker run --platform amd64  <image>latest

When I tried passing it in the driver attributes, e.g:

   task "task" {
      driver = "docker"
      platform = "amd64"
      config {
        image = "image:latest"

I got the below error:
An argument named "platform" is not expected here

Is there a way to achieve it using Nomad?


You could add a constraint, specifying the cpu-architecture. See:

@runeron First, thanks for your answer!
Your solution could work if I only ran a specific platform on my hosts.
But I want the ability to control it from the docker side, so I can keep running different platforms on the same host.