machine icon indicating copy to clipboard operation
machine copied to clipboard

`docker-machine upgrade` not upgrading from 1.11.0 to 1.12.0-rc2

Open dolan-a opened this issue 10 years ago • 19 comments

I have the following version locally: Docker version 1.12.0-rc2, build 906eacd, experimental (using OS X and the Docker Beta native app). Docker-machine version 0.8.0-rc1, build fffa6c9

I have a machine (test1) on digitalocean, created via docker-machine. When I run docker-machine upgrade test1, I get the following output:

Waiting for SSH to be available...
Detecting the provisioner...
Upgrading docker...
Restarting docker...

Yet after docker-machine upgrade, remote machine remains on 1.11.0. Is there some restriction that prevents upgrading to a release candidate?

The problem is I cannot run commands like docker volume ls; I get the following error:

Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.23)

If I manually update docker (following this SE post), the correct version installs (1.12.0-rc2) and my above command works fine.

dolan-a avatar Jun 20 '16 18:06 dolan-a

After further investigation, I noticed that creating a new machine on digitalocean installs v1.11.2 on the remote machine, so I'm thinking this is related to me running the beta software.

As a work-around for this API version error, an environment variable can be set as follows: export DOCKER_API_VERSION=1.23

I'll leave this open for now in case there is an issue here. If the stable version is being installed on purpose, perhaps the docker-machine upgrade can at least alert the user of what's going on?

dolan-a avatar Jun 20 '16 18:06 dolan-a

My question: how to using docker-machine create new machine with docker 1.12.0-rc2?

ghost avatar Jun 21 '16 01:06 ghost

@netroby the SE link that @pydolan provided worked well for me

kweiberth avatar Jun 21 '16 19:06 kweiberth

Does we have to wait for 1.12 final to use docker-machine upgrade?

ghost avatar Jun 22 '16 18:06 ghost

the SE link worked for me, although I had to remove docker because 1.12 warned about issues when overwriting an existing docker version. The final list of commands I did for a single box do-manager1:

docker-machine ssh do-manager1 "apt-get purge -y docker-engine"
docker-machine ssh do-manager1 "apt-get autoremove --purge -y docker-engine"
docker-machine ssh do-manager1 "rm -rf /var/lib/docker"
docker-machine ssh do-manager1 "curl -fsSL https://test.docker.com/ | sh"
docker-machine ssh do-manager1 "killall dockerd"
docker-machine ssh do-manager1 "docker daemon" &
docker-machine regenerate-certs do-manager1

neilsarkar avatar Jun 22 '16 22:06 neilsarkar

I should mention that virtualbox installs 1.12 properly, it's just digitalocean and aws drivers that are installing 1.11.2

After reading the docs I realized we can specify test.docker.com when creating the image instead of mucking about with ssh commands:

$ docker-machine create -d digitalocean --engine-install-url https://test.docker.com --digitalocean-access-token=REDACTED do-manager1

neilsarkar avatar Jun 22 '16 22:06 neilsarkar

--engine-install-url seems not to be allowed for virtualbox driver. How do I create a virtualbox machine with docker 1.12?

eungjun-yi avatar Jun 23 '16 06:06 eungjun-yi

I got it. How to create a virtualbox machine with docker 1.12:

docker-machine create -d virtualbox --virtualbox-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.12.0-rc2/boot2docker-experimental.iso node1

eungjun-yi avatar Jun 23 '16 06:06 eungjun-yi

Ah yeah I'm using Docker for Mac and had removed my boot2docker iso, so it downloaded the latest one automatically for virtualbox. Your approach seems more foolproof.

neilsarkar avatar Jun 23 '16 16:06 neilsarkar

Docker Toolbox 1.12.0-rc2 should also work to install all the latest RCs for you. https://github.com/docker/toolbox/releases/tag/v1.12.0-rc2

nathanleclaire avatar Jun 23 '16 17:06 nathanleclaire

@neilsarkar the URL to be provided for installing 1.12 in Digital Ocean is https://experimental.docker.com/ instead of https://test.docker.com:

$ docker-machine create -d digitalocean --engine-install-url https://experimental.docker.com/ ...

Update: nevermind, I made a mistake testing with test.docker.com! Both URLs work and in fact more recommended is the one provided by @neilsarkar (release candidate) rather than the one I provided (experimental builds)

fran0x avatar Jun 26 '16 15:06 fran0x

While technically not related to the actual title of this issue :), I want to confirm here that I'm running Docker 1.12.0-rc2 beta 17 build 5022 on Windows and that the --engine-install-url https://test.docker.com works great here for creating an Azure VM with docker-machine installed. Thanks for posting the solution on this issue, folks!

» docker version Client: Version: 1.12.0-rc2 API version: 1.24 Go version: go1.6.2 Git commit: 906eacd Built: Fri Jun 17 20:35:33 2016 OS/Arch: windows/amd64 Experimental: true

Server: Version: 1.12.0-rc3 API version: 1.24 Go version: go1.6.2 Git commit: 91e29e8 Built: Sat Jul 2 00:33:46 2016 OS/Arch: linux/amd64

jflam avatar Jul 05 '16 17:07 jflam

I think the issue can be closed... docker-machine upgrade is not intended to upgrade to 1.12 until the actual release happens (we're still in release candidate phase right now).

nathanleclaire avatar Jul 05 '16 20:07 nathanleclaire

Link "https://test.docker.com" works for me in AWS:

$ docker-machine create --driver amazonec2 --engine-install-url https://test.docker.com --amazonec2-vpc-id vpc-608b6f09 --amazonec2-request-spot-instance --amazonec2-spot-price 0.10 --amazonec2-region eu-central-1 --amazonec2-instance-type m3.large dck-01

Docker version: v1.12.0-rc4 docker-machine version 0.7.0, build a650a40

JoseIbanez avatar Jul 13 '16 18:07 JoseIbanez

So now that v1.12.0 is out, how do we upgrade to it from the release candidate?

If I run docker-machine upgrade, it upgrades me to -rc5, and not the release version. Perhaps that's because I specified --engine-install-url to be test.docker.com? How do I undo that?

Edit:

I edited ~/.docker/machine/machines/machine-name-here/config.json and changed the InstallURL value to https://get.docker.com and that does not seem to work.

arianitu avatar Aug 08 '16 21:08 arianitu

Running 1.11 and still can not upgrade to 1.12.

earthquakesan avatar Aug 15 '16 10:08 earthquakesan

For others running into this issue. The upgradeability of your nodes will also depend on the distro you are using.

For example: right now docker 1.12 is not available on CoreOS Stable.. only on Alpha. This might apply for other distributions too.

maxfrigge avatar Sep 26 '16 15:09 maxfrigge

I does not upgrade from 1.11.2 to 1.12.3

docker-machine.exe upgrade node2
Waiting for SSH to be available...
Detecting the provisioner...
Upgrading docker...
Restarting docker...

still same version

docker-machine.exe provision node2
Waiting for SSH to be available...
Detecting the provisioner...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Configuring swarm...

still same version

client is newer than server (client API version: 1.24, server API version: 1.23)

MRezaNasirloo avatar Nov 27 '16 01:11 MRezaNasirloo

@Pedramrn make sure docker-machine is latest version available, and you might want to check your /etc/apt/sources.list.d to make sure the docker setup looks legit -- worst case you can do something like docker-machine ssh node2 sh -c 'sudo apt-get update && sudo apt-get install -y docker-engine'

nathanleclaire avatar Dec 02 '16 00:12 nathanleclaire