2

docker-machine provides an upgrade command, however it only upgrades to the latest stable version

I want to install 1.10RC2 on my docker machines and I am uncertain the steps to do this

UPDATE

On the docker releases page it shows this command:
curl -fsSL https://test.docker.com/ | sh

I thought I'd try that out. I ssh'd in via docker-machine ssh swarm-master and ran it.

It looked promising... running it appears to be an install/upgrade script, it did a bunch of stuff. Afterwards:

root@swarm-master:~# docker version
Client:
 Version:      1.10.0-rc2
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   c1cdc6e
 Built:        Wed Jan 27 22:14:06 2016
 OS/Arch:      linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

Seems to have upgraded, but daemon not running.

https://docs.docker.com/engine/articles/systemd/ shows a couple of ways. I tried:

$ sudo systemctl start docker

and

$ sudo service docker start

In both cases the command returns without output but hasn't seemed to have done anything, the daemon is still not running.

My host is Debian 8.

I can do docker daemon and it runs in foreground... doing so for the first time it went through and migrated all my images... seems to work fine but

So my question is now - how to properly (as in: same way that docker-machine would do it) run the daemon?

3

So, I found a way:

$ docker-machine ssh swarm-master
swarm-master# curl -fsSL https://test.docker.com/ | sh
swarm-master# docker daemon

Wait for the daemon to update all the images to 1.10 format and then leave it running.

Meanwhile in another shell:

$ docker-machine regenerate-certs swarm-master

(I don't know why we have to do this, but the last restart fails without it)
The command should complete, albeit with the following warning:

Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Unable to verify the Docker daemon is listening: Maximum number of retries (10) exceeded

Then:

$ docker-machine restart swarm-master
$ eval $(docker-machine env --swarm swarm-master)
$ docker-machine ls

At this point you should see the master upgraded and running:

NAME           ACTIVE      DRIVER         STATE     URL                       SWARM                   DOCKER        ERRORS
swarm-master   * (swarm)   digitalocean   Running   tcp://123.45.67.89:2376   swarm-master (master)   v1.10.0-rc2

Repeat the same steps (minus the eval env) for each machine in the swarm.

Unfortunately there is still a problem:

NAME           ACTIVE      DRIVER         STATE     URL                        SWARM                   DOCKER        ERRORS
swarm-1        -           digitalocean   Running   tcp://123.45.67.98:2376    swarm-master            v1.10.0-rc2
swarm-master   * (swarm)   digitalocean   Running   tcp://123.45.67.89:2376    swarm-master (master)   v1.10.0-rc2

Looks good yeah?

But:

$ docker info
Containers: 7
Images: 13
Role: primary
Strategy: spread
Filters: health, port, dependency, affinity, constraint
Nodes: 1
 swarm-master: 123.45.67.89:2376
  └ Status: Healthy
  └ Containers: 7
  └ Reserved CPUs: 0 / 1
  └ Reserved Memory: 0 B / 1.026 GiB
  └ Labels: executiondriver=native-0.2, kernelversion=3.16.0-4-amd64, operatingsystem=Debian GNU/Linux 8 (jessie), provider=digitalocean, storagedriver=aufs
CPUs: 1
Total Memory: 1.026 GiB
Name: 0dc444daa840

Only one node recognised as part of the swarm :(

To fix this, go in to the missing swarm node:

$ docker-machine ssh swarm-1
swarm-1# docker run -d swarm join --addr=<node ip>:2376 consul://<consul ip>:8500

docker info should now show both nodes are in the swarm.

| improve this answer | |
0

Surprised this has not been properly answered yet, and perhaps things changed but this is very easy. I just ran this test on a swarm with a master and two members.

Before:

C:\> docker version
Client:
 Version:      17.06.0-ce
 API version:  1.29 (downgraded from 1.30)
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:30:30 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.05.0-ce
 API version:  1.29 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 21:43:09 2017
 OS/Arch:      linux/amd64
 Experimental: false

Here are the commands in order:

C:\> docker-machine upgrade default

Waiting for SSH to be available...
Detecting the provisioner...
Upgrading docker...
Stopping machine to do the upgrade...
Upgrading machine "default"...
Copying I:\Docker\cache\boot2docker.iso to I:\Docker\machines\default\boot2docker.iso...
Starting machine back up...
Restarting docker...


C:\> docker-machine upgrade swarmnode02

Waiting for SSH to be available...
Detecting the provisioner...
Upgrading docker...
Stopping machine to do the upgrade...
Upgrading machine "swarmnode02"...
Copying I:\Docker\cache\boot2docker.iso to I:\Docker\machines\swarmnode02\boot2docker.iso...
Starting machine back up...
Restarting docker...


C:\> docker-machine upgrade swarmnode03

 Waiting for SSH to be available...
Detecting the provisioner...
Upgrading docker...
Stopping machine to do the upgrade...
Upgrading machine "swarmnode03"...
Copying I:\Docker\cache\boot2docker.iso to I:\Docker\machines\swarmnode03\boot2docker.iso...
Starting machine back up...
Restarting docker...

After:

C:\> docker version
Client:
 Version:      17.06.0-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:30:30 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.06.1-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   874a737
 Built:        Thu Aug 17 22:54:55 2017
 OS/Arch:      linux/amd64
 Experimental: false

C:\> docker-machine ls
NAME          ACTIVE   DRIVER              STATE     URL                          SWAR
M   DOCKER        ERRORS
default       *        vmwareworkstation   Running   tcp://192.168.200.132:2376
    v17.06.1-ce
swarmnode02   -        vmwareworkstation   Running   tcp://192.168.200.133:2376
    v17.06.1-ce
swarmnode03   -        vmwareworkstation   Running   tcp://192.168.200.134:2376
    v17.06.1-ce
| improve this answer | |
  • my question was specifically about upgrading to a non-final version, i.e. at the time it was 1.10RC2... yes the docker-machine upgrade command works fine to upgrade to current release version – Anentropic Aug 24 '17 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.