## yum install source
# 1, update yum
yum Update
#2、删除旧版本
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
# 3, yum-config-manager installation package like
yum yum the install -Y-utils \
Device-Mapper-persistent-Data \
LVM2
# 4, the source added yum
yum-config-Manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
# 5, start or prohibit the night repository and test repository (optional)
to enable
yum-config-manager --enable-ce-Docker Nightly
yum-config-manager --enable Docker-ce the Test-
ban
yum-config-manager Nightly Docker-CE---disable
yum-config-Manager --disable Docker-CE-Test
# 6, installation
Install the latest version of Docker CE and containerd
yum install Docker Docker-ce-ce-cli containerd.io
If you are installing another version is:
1, through yum list docker-ce --showduplicates | sort -r command to view the version information
Docker-ce.x86_64 18.06.3.ce-3.el7-ce-stable Docker
Docker-ce.x86_64 Docker-CE-3.el7 18.06.2.ce the stable-
Docker Docker-ce.x86_64 18.06.1.ce-3.el7 the stable-CE-
Docker-ce.x86_64 18.06.0.ce Docker-CE-3.el7 -STABLE
Docker Docker-ce.x86_64 18.03.1.ce-1.el7.centos the stable-CE-
Docker Docker-ce.x86_64 18.03.0.ce-1.el7.centos the stable-CE-
Docker-ce.x86_64 17.12 Docker-CE-1.el7.centos .1.ce the stable-
Docker Docker-ce.x86_64 17.12.0.ce-1.el7.centos the stable-CE-
Docker-ce.x86_64 17.09.1.ce-1.el7 the stable-CE-Docker .centos
Docker-ce.x86_64 17.09.0.ce-1.el7.centos the stable-CE-Docker
2, select the version Installation
yum install -y docker-ce- <VERSION_STRING > docker-ce-cli- <VERSION_STRING> containerd.io
example:
yum the install -Y-18.03.1.ce Docker Docker-CE-CE-CLI-18.03 .1.ce containerd.io
# 7, start
systemctl start docker
#8、测试
docker pull centos
docker run centos echo "hello word"
# 9, see the version information
docker version
### uninstall
yum remove docker-ce
## remove the mirror
rm -rf / var / lib / docker