Compatible versions of docker-ce and docker-ce-cli

I will take the specific case of CentOS here. It is similar for other Linux distros. Docker official documentation mentions the following for installing specific versions

sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io docker-buildx-plugin docker-compose-plugin

If I check the versions of docker-ce and docker-ce-cli, I see the following

sudo yum list docker-ce --showduplicates | sort -r
docker-ce.x86_64               3:26.1.1-1.el8                  docker-ce-stable 
docker-ce.x86_64               3:26.1.0-1.el8                  docker-ce-stable 
docker-ce.x86_64               3:26.1.0-1.el8                  docker-ce-stable
docker-ce.x86_64               3:26.0.2-1.el8                  docker-ce-stable 
docker-ce.x86_64               3:26.0.1-1.el8                  docker-ce-stable 
docker-ce.x86_64               3:26.0.0-1.el8                  docker-ce-stable 
docker-ce.x86_64               3:25.0.5-1.el8                  docker-ce-stable 
docker-ce.x86_64               3:25.0.4-1.el8                  docker-ce-stable 
....

sudo yum list docker-ce-cli --showduplicates | sort -r
docker-ce-cli.x86_64              1:26.1.1-1.el8                docker-ce-stable
docker-ce-cli.x86_64              1:26.1.0-1.el8                docker-ce-stable
docker-ce-cli.x86_64              1:26.0.2-1.el8                docker-ce-stable
docker-ce-cli.x86_64              1:26.0.1-1.el8                docker-ce-stable
docker-ce-cli.x86_64              1:26.0.0-1.el8                docker-ce-stable
docker-ce-cli.x86_64              1:25.0.5-1.el8                docker-ce-stable
docker-ce-cli.x86_64              1:25.0.4-1.el8                docker-ce-stable
docker-ce-cli.x86_64              1:25.0.3-1.el8                docker-ce-stable
....

Docker documentation doesn’t mention anything about the compatibility of the versions of docker-ce and docker-ce-cli.

I am sure I just can’t install random version of docker-ce along with a random version of docker-ce-cli.

Looking at the version number formats e.g. 3:25.0.4-1.el8, the string on the right of semicolon is identical in docker-ce and docker-ce-cli, i.e. 25.0.4-1.el8. It seems we should keep that string identical for docker-ce and docker-ce-cli when installing docker in Linux, e.g.

sudo yum install docker-ce-3:25.0.4-1.el8 docker-ce-cli-1:25.0.4-1.el8 containerd.io docker-buildx-plugin docker-compose-plugin

Could someone clarify.

The first field is the epoch, see: https://rpm-packaging-guide.github.io/#epoch

As long as the version (regardless of the epoch) matches, it will work.

1 Like

docker-ce-cli is the Docker client. The Docker client uses the Docker API to communicate with the deamon. As long as the API calls sent by the Docker client are compatible with the Docker Daemon, you can use the client. Of course, the best if you use the same version of the client and the daemon and when you install Docker CE, you should choose the same versions, but when you have a remote Docker daemon, you can have a single Docker client and multiple remote servers with different versions of the docker daemon.

The output of

docker version

shows what version the daemon supports and what version of the client will use.

Client: Docker Engine - Community
 Version:           26.0.1
 API version:       1.45
 ...

Server: Docker Engine - Community
 Engine:
  Version:          26.0.1
  API version:      1.45 (minimum version 1.24)
  ...

Before installing Docker, you can check the API version matrix in the documentation

https://docs.docker.com/engine/api/#api-version-matrix

This is the current matrix:

Docker version Maximum API version
26.1 1.45
26.0 1.45
25.0 1.44
24.0 1.43
23.0 1.42
20.10 1.41
19.03 1.40
18.09 1.39
18.06 1.38
18.05 1.37
18.04 1.37
18.03 1.37
18.02 1.36
17.12 1.35
17.11 1.34
17.10 1.33
17.09 1.32
17.07 1.31
17.06 1.30
17.05 1.29
17.04 1.28
17.03.1 1.27
17.03 1.26
1.13.1 1.26
1.13 1.25
1.12 1.24
2 Likes

How do I find out which version of docker-ce-cli has which version of API before installing?
Or did you mean the first column Docker version in the API version matrix is also the version of docker-ce-cli? I presumed, the phrase Docker version means Docker engine or Docker daemon.

docker-ce is the package of the daemon. docker-ce-cli is the package of the client. The client supports only one version. which you can check in the output I shared in my previous response. In the table the second column is “Maximum API version”. Since the client has only one supported version, Docker version is the version of the daemon.

In the docker version output you can see “minimum version” in the Server section. That equals to the maximum version in the matrix and equals to the client api version in my shared output.

When you already have a client, you know which version it supports. When you don’t have the client, install the same version as the daemon. I just shared how you can find out if your existing components are compatible with eachother.

But read the the whole documentation to understand more. I only quoted the matrix without the context