Older version of Docker were called
docker
ordocker-engine
. The Docker Engine package is now calleddocker-ce
.
-
uninstall old versions
1
2
3
4
5
6
7
8sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine -
set up the repository
1
2
3
4
5sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo -
install Docker Engine
1
sudo yum install docker-ce docker-ce-cli containerd.io
-
start Docker
1
sudo systemctl start docker
-
verify that Docker Engine is installed correctly by running the
hello-world
image.1
sudo docker run hello-world
-
upgrade Docker Engine
1
yum -y upgrade docker-ce
-
view docker version number
1
docker version --format {{.Server.Os}}-{{.Server.Version}}