We have a Docker stack compose file using services built for x86. To get our dev-setup running locally on my Apple Silicon/M1/ARM chip, I tried to deploy the stack using docker stack deploy. The services won’t run and fail citing the unsupported architecture on the node. Is there a way to emulate an intel architecture on my docker swarm node? Or to run the x86 services using rosetta?
The --platform
flag mentioned in the docs does not seem to work for the Docker stack.
2
Answers
We have found a solution:
docker stack
deploys pre-built images. You will get an "unsupported platform" error for any service which doesn't have an arm-build.Using the
--platform linux/amd64
trick doesn't work for docker stack because it has no--platform
option. What you need to do instead is:make sure the services of the stack are locally available (for example by executing docker stack deploy with you docker stack yml file, which again will fail to start the services but download them).
add
--resolve-image "never"
to your docker stack deploy, for example:docker stack deploy --resolve-image "never" --compose-file=./stack.yml
Now the services will started, using rosetta/qemu emulation in the background for the x86 services. This is not advised and can lead to faulty behavior and bad performance. For example, in my case the x86 keycloak image would start but not work. In those cases, it is necessary to build the service locally for arm.
The following command worked for me: