After creating a new machine with Docker Machine, I'm getting the following error:
$ docker ps
Error response from daemon: client is newer than server(client API version 1.21, server API version: 1.19)
How can I fix this?
docker-machine upgrade <your-machine>
will do the trick. This can happen - as it did for me - even if you're not using RCs and your machine was newly created. It would be due to an ISO cache issue. The error is commented in this thread.
If the docker client is 1.9.x and the server is running docker 1.8.x, the error message is observed.
If someone happens to get this error, but is not using docker-machine
, there is another way to resolve the issue by specifying an older API version in an environment variable on the client side:
export DOCKER_API_VERSION=<version>
for example:
export DOCKER_API_VERSION=1.19
and retrying the docker
command.
Reference.
On ubuntu distrib it happens after an apt update, if docker run as a service. The client is updated but the old version of the server is still running.
In this case just do a:
sudo service docker restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With