We have a slightly older Docker server running on RHEL 6.6. It's not well-supported by our operations team right now, so we can't upgrade easily. Right now it runs Docker 1.3.2 from an EPEL repo. If I ssh in it does everything that I need for proofs-of-concept that will hopefully help me push management to improve the infrastructure support for Docker down the road.
I set it up to listen on TCP/TLS, and I'm able to connect to it, but it refuses to run commands given by my local docker client.
$ docker version
Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.4
Git commit (client): 5bc2ff8
OS/Arch (client): darwin/amd64
FATA[0000] Error response from daemon: client and server don't have same version (client : 1.16, server: 1.15)
I know the connection itself works because fig
works:
$ cat > fig.yml
test:
image: busybox
$ fig run --rm test sh
/ # hostname -f
084f75fb59d4
Is there some way I can tell the newer docker client to use the older docker API version until I can access to a newer docker host?
Best Answer
Since Docker 1.10.0, there's an option for overriding the API Version used for Docker client communication with Docker engine.
Just by using the DOCKER_API_VERSION environment variable.
Ex.:
Reference: https://docs.docker.com/engine/reference/commandline/cli/#environment-variables
EDIT
Since Docker 1.13, CLI has an improved backwards compatibility. According to https://blog.docker.com/2017/01/whats-new-in-docker-1-13 :