docker swarm - support for platform property in compose
Description
Hello I am facing error on my localhost, where I am trying to test our deployment script with docker swarm.
I had to add platform property to docker compose because I am running on ARM and images are build for linux/amd64. So I am able to pull them locally.
docker stack deploy --with-registry-auth -c docker-compose.yml apps
services.ppo Additional property platform is not allowed
yes this feature will be helpful, as it is available in docker but not in swarm
Hey @thaJeztah Sir,
I’ve looked into this issue and would like to help implement support for the platform property in Docker Swarm.
From what I understand, the error occurs because the current stack deploy schema doesn’t recognize platform as a valid field. The Compose CLI supports it when running containers directly, but the Swarm stack deployment path doesn’t propagate this field to the engine.
I’d like to confirm:
- Would the expected behavior be for Swarm to accept the
platformfield under each service and pass it through to theContainerSpec.Platformproperty in the service definition? - Are there any known design constraints or reasons this was previously omitted?
If this approach sounds reasonable, I’d be happy to open a PR to prototype the change and update the stack schema accordingly.