Docker Community Forums

Share and learn in the Docker community.

What are the steps when upgrading docker engine on swarm?


Just for clarifying, what is the correct way to upgrade docker engine on swarm?
Is it important to upgrade the manager engines first?

And then:

  1. Drain first node.sudo docker node update --availability drain worker2
  2. Verify No containers are on drained node.sudo docker ps #on worker2
  3. Upgrade docker engine.
  4. Check node in swarm manager.sudo docker node ls
  5. Change availability to Active.sudo docker node update --availability Active
  6. Repeat the steps for other nodes.

And when upgrading from 17.x to 20.x, is it mandatory to upgrade major version at a time, or is possible to jump like 18.x to 20.x?

Thanks for any advantage!

1.) start with the managers first: set node to drain, wait until all swarm service tasks on the node are drained, update engine version, wait until the updated node is shown as rechable in docker node ls, set node to active, continue with next manager node, then continue with the worker nodes one by one.

2.) Sadly I have no idea wether a version jump from 17.x to 20.x works, a jump from 18.x to 20.x definitly works and was the “normal case” as a stable 19.x never was released. To be sure, you can backup the swarm state in order to have a desaster recovery point.

Good luck!

Many thanks for clarifying!
I will go with upgrading from 17.x to 18.x first, as swarm should work with mixed versions 17.x and 18.x, and from 18.x jump to 20.x. I will also check how to backup the swarm state.