Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 944
OlegI Avatar asked Aug 16 '26 07:08

OlegI


1 Answers

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.

like image 119
Oliver Avatar answered Aug 18 '26 04:08

Oliver



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!