Docker Commands Fail with a Docker API Version Error

After a successful deployment of a vSphere Integrated Containers Engine virtual container host (VCH), attempting to run a Docker command fails with a Docker version error.

Problem

When you attempt to run a Docker command from a Docker client that is connecting to a VCH, the command fails with the following error:

Error response from daemon: client is newer than server 
(client API version: x.xx, server API version: 1.23)

Cause

This version of vSphere Integrated Containers Engine supports Docker 1.11, that includes version 1.23 of the Docker API. You are using a more recent version of the Docker client, that includes a version of the Docker API that is incompatible.

Solution

  1. Open a terminal on the system on which you run the Docker client.
  2. Set the Docker client API to the same version as the one that is used by vSphere Integrated Containers Engine.

    export DOCKER_API_VERSION=1.23
  3. Check that your Docker client can now connect to the VCH by running a Docker command.

    • With TLS authentication:
      docker -H virtual_container_host_address:2376 --tls info
    • Without TLS authentication:
      docker -H virtual_container_host_address:2375 info

    The docker info command should succeed and you should see information about the VCH.