cli icon indicating copy to clipboard operation
cli copied to clipboard

docker swarm - support for platform property in compose

Open landsman opened this issue 2 months ago • 2 comments

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

landsman avatar Oct 08 '25 05:10 landsman

yes this feature will be helpful, as it is available in docker but not in swarm

Sudhegan avatar Oct 25 '25 20:10 Sudhegan

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 platform field under each service and pass it through to the ContainerSpec.Platform property 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.

2003Aditya avatar Nov 02 '25 18:11 2003Aditya