Answers: <p>It <em>is</em> safe. As soon as docker returns it is safe to logout/leave the shell.</p>
  
  <p>The issue was that Docker 18.06.0-ce <strong>broke</strong> <code>docker stack deploy</code>. Reverting to 18.03.1 (specifically <code>18.03.1~ce-0~ubuntu</code>) made it work.</p>
  
Answers: CC BY-SA 4.0
Answers: 2018-08-18T03:02:19.647Z
Answers: 2018-08-18T03:02:19.647Z
Answers: Andriy Drozdyuk
Body: <p>If I immediately terminate the process that called <code>docker stack deploy</code> will the docker swarm continue?</p>
  
  <p>My use case is this:</p>
  
  <ol>
  <li>In my CI job I ssh into my swarm cluster node.</li>
  <li>I copy the new stack.yml file and issue</li>
  <li><code>docker stack deploy -c stack.yml stack</code></li>
  <li>Since this immediately returns, my CI job disconnects from ssh.</li>
  </ol>
  
  <p>My question is whether this can lead to some unforeseen side-effects? Is my deploy being terminated midway? Or will docker swarm be smart enough to keep going on its own.</p>
  
  <p>Thanks</p>
  
Comments: CC BY-SA 4.0
Comments: 2018-08-16T17:47:50.643Z
Comments: You could test it: run the cmd through a ssh session and ctrl-D once you issue it
Comments: Dan Cornilescu
Comments: CC BY-SA 4.0
Comments: 2018-08-17T05:20:30.627Z
Comments: I'm getting weird behaviour, regardless of what I do. Some of my services (out of 3 replicas) get updated, while others don't...
Comments: Andriy Drozdyuk
Comments: CC BY-SA 4.0
Comments: 2018-08-17T09:13:08.093Z
Comments: Sounds like it's not safe. Try adding a custom CI step consisting in checking the stack deployment, based on `docker stack stack services` executions...
Comments: Dan Cornilescu
Tags: <docker><docker-swarm><cicd>
Title: Is it ok to logout after calling docker stack deploy?
UserDisplayName: Andriy Drozdyuk
ThreadText: # Is it ok to logout after calling docker stack deploy?
  
  (Asked by: username_0 on 2018-08-15)
  
  If I immediately terminate the process that called `docker stack deploy` will the docker swarm continue?
  
  My use case is this:
  
  1. In my CI job I ssh into my swarm cluster node.
  2. I copy the new stack.yml file and issue
  3. `docker stack deploy -c stack.yml stack`
  4. Since this immediately returns, my CI job disconnects from ssh.
  
  My question is whether this can lead to some unforeseen side-effects? Is my deploy being terminated midway? Or will docker swarm be smart enough to keep going on its own.
  
  Thanks
  
  **Tags:** docker, docker-swarm, cicd
  
  > **Comments:**
  > **username_1**: You could test it: run the cmd through a ssh session and ctrl-D once you issue it  
  > **username_0**: I'm getting weird behaviour, regardless of what I do. Some of my services (out of 3 replicas) get updated, while others don't...  
  > **username_1**: Sounds like it's not safe. Try adding a custom CI step consisting in checking the stack deployment, based on `docker stack stack services` executions...  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-08-18. Score: 1 | Accepted answer
  
  It *is* safe. As soon as docker returns it is safe to logout/leave the shell.
  
  The issue was that Docker 18.06.0-ce **broke** `docker stack deploy`. Reverting to 18.03.1 (specifically `18.03.1~ce-0~ubuntu`) made it work.
  
  
  ---
  
  