OlegI
OlegI

Reputation: 6010

Docker Swarm stack deploy specific service

I have multiple services in a compose file and I need to deploy only one specific service. Does docker swarm support this? Example of a docker-compose file:

version: '3.7'
services:
  bar:
    image: bar:latest
    deploy:
        resources:
          limits:
            memory: 256M

  foo:
    image: foo:latest
    deploy:
      resources:
        limits:
          memory: 256M  

So the command to deploy to stack mystack both services is:

docker stack deploy -c docker/docker-compose.yml mystack

I want to deploy just Foo service. Expect the command to be something like:

docker stack deploy -c docker/docker-compose.yml foo mystack

Upvotes: 7

Views: 7124

Answers (1)

Oliver
Oliver

Reputation: 29

Based on my research, this seems like a limitation with the stack deploy command as described here on this moby issue. I don't think there is any road map to add this feature to Docker. Having said that, the docker stack deploy command should be able to do a diff and only update services that have new images or config changes in the yaml file.

Upvotes: 1

Related Questions