-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow passing options to docker service update
from yml file
#41241
Comments
Thanks for posting; could you describe why you would require multiple docker-compose files to update a service? If changes were made to a single service in the stack, only that service would be updated (or at least, it should 😅), so wondering why. |
I don't require multiple docker-compose files for service. I need single compose file per service. |
Having Another possibility would be to have an additional command specifically for this (something like |
Another possibility would be to have an additional command specifically for this (something like docker stack update)
That's what docker stack deploy does; if you deploy a stack, update the compose file, and run deploy again, docker swarm will reconcile the configuration
… On 11 Oct 2020, at 19:45, Andreas ***@***.***> wrote:
Another possibility would be to have an additional command specifically for this (something like docker stack update)
|
Thanks, I didn't realize An overview in the documentation about how |
Description
I'm deploying several independent services to swarm cluster.
Currently
docker service update
command accepts spec change viaxxx-add / xxx-rm
cli flags (see #25303).Frankly, it looks to me not very convenient. Instead of having declarative description of service state I need to provide imperative instructions leading to some state.
I've tried two workaround to define service in file:
Describe each service in own
docker-stack.yml
file and deploy each service viadocker stack deploy
. Having deployment config in yml file is very convenient. But usingdocker stack
has for me following disadvantages:docker stack deploy
still does not have--detach
mode. It means I can't see deploy result and deploy logs - it's blocker for me. In contrast I really like the output ofdocker service update
command and it supports--detach
mode.$STACK_$SERVICE
instead of justmyservice
.Describe service deployment in shell script with
docker service update
. E.g.# deploy.sh docker service update \ --replicas 3 \ --network-add traefik \ --label-add traefik.enable=true \ ... myservice
But it does not work, as for example if service already added to network
traefik
, the command fails.Proposal
Add cli flag
--compose-file
todocker service update
:With the following
docker-stack.yml
it should deploy onlymyservice
:In related issues several people were interested in providing full spec of service instead of delta.
Another alternative is to introduce
docker service deploy
command that will deploy particularly one service from stack file. Anyway the purpose is to allow declaratively describe service and deploy it.I've investigated the source code of docker-cli - it seems
apiClient.ServiceUpdate
already accepts full service spec. So I hope it is possible to implement with not much effort.Output of
docker version
:See below
The text was updated successfully, but these errors were encountered: