If you receive the following error:
Error response from daemon: client version 1.40 is too new. Maximum supported API version is 1.39
It indicates the Drone runner uses a newer version of the Docker Client API than your Docker daemon. You can see the API version of your Docker daemon by running docker version on he host:
Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:38:12 2018
OS/Arch: linux/arm
Experimental: false
The recommended solution to this error is to upgrade your Docker daemon to a more recent release. However, if this is not an option we can configure the Drone runner to downgrade its version of the Docker Client API by passing the following environment variable to the runner:
--env=DOCKER_API_VERSION=1.38
If you are spawning runners using the autoscaler, you can set the autoscaler’s DRONE_AGENT_ENVIRON variable to define environment variables that are passed down the runner:
--env=DRONE_AGENT_ENVIRON=DOCKER_API_VERSION:1.38