Different version of docker server and client

Hi,

To be able to run docker commands from inside a container, we installed docker-io in the image(and mounted docker.sock) . we have been updating the docker over the years and now we are upgrading to docker-ce 18.06. But didn’t update the docker-io inside the container. As a result when i do ‘docker version’ from inside a container, it gives:

sudo docker version:

Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2

Server version: 18.06.1-ce
Server API version: 1.38
Go version (server): go1.10.3

So how will this effect the working? Does the client version need the update too?

Thanks

I would advise to modify your image:

  • either do not install docker in the image and add an additional volume mount to mount the hosts docker client binary inside the container

  • or modify the Dockerfile to install a later docker-ce version

There is actualy a way to override the supported API version using an environment variable, though since the version inside your container is Docker 1.9 (=API 1.19), I would strongly advice to not use it.

DOCKER_API_VERSION='1.19'
1 Like