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.