Installing docker in CentOS


1. Check whether docker has been installed before, and then uninstall it

$ sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \

2. Installation environment dependence

 sudo yum install -y yum-utils \
device-mapper-persistent-data \

sudo yum-config-manager \
--add-repo \

Install docker

$ sudo yum install docker-ce docker-ce-cli

Start docker service

sudo systemctl start docker 

Test whether docker is installed successfully

Sudo docker run Hello World: Hello from docker indicates successful installation

Official installation tutorial…

This work adoptsCC agreementReprint must indicate the author and the link of this article