Docker Machine “client is newer than server” error

Posted by: Arun Gupta on November 3, 2015

Docker 1.9.0 is getting ready to be released. Docker Release Candidate builds can be downloaded from github.com/docker/docker/releases. Matching Docker Machine Release Candidate builds can be downloaded from github.com/docker/machine/releases.

So, you downloaded Docker Machine and Docker CLI Release Candidate build. The latest one at this time is 1.9.0 RC4 for Docker and 0.5.0 RC4 for Docker Machine.

Download is pretty straight forward:

curl -L https://test.docker.com/builds/Darwin/x86_64/docker-1.9.0-rc4 > /usr/local/bin/docker

And now Docker Machine:

curl -L https://github.com/docker/machine/releases/download/v0.5.0-rc4/docker-machine_darwin-amd64.zip >machine.zip && \
  unzip machine.zip && \
  rm machine.zip && \
  mv docker-machine* /usr/local/bin

A big change in Docker Machine is where implementation of drivers such as virtualbox, digitalocean, amazonec2, etc are no longer packaged in the main binary. Instead the distribution is a zip bundle with multiple drivers packaged and referenced from the main binary. These are now packaged separately and has the following benefits:

  1. Each driver can evolve rapidly without waiting for merging into upstream
  2. Additional drivers can be written and used without merging into the upstream
  3. New version of the drivers can be released more frequently. Hopefully more clarity will be available on how these drivers will be distributed.

That’s why installation is slightly different and looks like:

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   608    0   608    0     0    132      0 --:--:--  0:00:04 --:--:--   132
100 38.8M  100 38.8M    0     0   364k      0  0:01:49  0:01:49 --:--:--  450k
Archive:  machine.zip
  inflating: docker-machine          
  inflating: docker-machine-driver-amazonec2  
  inflating: docker-machine-driver-azure  
  inflating: docker-machine-driver-digitalocean  
  inflating: docker-machine-driver-exoscale  
  inflating: docker-machine-driver-generic  
  inflating: docker-machine-driver-google  
  inflating: docker-machine-driver-hyperv  
  inflating: docker-machine-driver-none  
  inflating: docker-machine-driver-openstack  
  inflating: docker-machine-driver-rackspace  
  inflating: docker-machine-driver-softlayer  
  inflating: docker-machine-driver-virtualbox  
  inflating: docker-machine-driver-vmwarefusion  
  inflating: docker-machine-driver-vmwarevcloudair  
  inflating: docker-machine-driver-vmwarevsphere

After installation, the Docker Machine can be created as:

> docker-machine create -d=virtualbox lab
Running pre-create checks...
Creating machine...
Waiting for machine to be running, this may take a few minutes...
Machine is running, waiting for SSH to be available...
Detecting operating system of created instance...
Provisioning created instance...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
To see how to connect Docker to this machine, run: docker-machine env lab

And Docker CLI is configured to talk to this machine as:

eval $(docker-machine env lab)

But now when you try to see the list of images on this machine as docker images, it gives the following error:

Error response from daemon: client is newer than server (client API version: 1.21, server API version: 1.20)

This was filed as #2147.

Fortunately, the fix is rather simple even though non-intuitive. Docker Machine needs to be created as:

docker-machine create -d=virtualbox -virtualbox-boot2docker-url https://github.com/tianon/boot2docker-legacy/releases/download/v1.9.0-rc4/boot2docker.iso lab2

This is so because use a RC Docker binary require to specify to use a release candidate ISO. This can be done by using -virtualbox-boot2docker-url option as shown.

Now when the Docker Machine is created this way, the empty list of images is shown correctly:

> docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE

Voila, back in business!

The post Docker Machine “client is newer than server” error appeared first on Miles to go 3.0 ....

Arun Gupta

About Arun Gupta

Arun Gupta is Director of Developer Advocacy at Red Hat and focuses on JBoss Middleware. As a founding member of the Java EE team at Sun Microsystems, he spread the love for technology all around the world. At Oracle, he led a cross-functional team to drive the global launch of the Java EE 7 platform through strategy, planning, and execution of content, marketing campaigns, and program. He is a prolific blogger since 2005 and have authored 1500+ blogs on technology. Arun has extensive speaking experience in ~40 countries on myriad topics and is a JavaOne Rockstar. He also founded the Devoxx4Kids chapter in the USA and continues to promoting technology education amongst kids. An author of a best-selling book, an avid runner, a globe trotter, a Java Champion, JUG leader, he is easily accessible at @arungupta.