Centos7 install the latest version of docker

Centos7 installs docker-ce, the latest version of docker, docker Aliyun acceleration
docker-ce refers to the community version of docker

Uninstall the old version of docker and its related dependencies
sudo yum remove docker docker-common container-selinux docker-selinux docker-engine

Install yum-utils, which provides yum-config-manager, which can be used to manage yum sources
sudo yum install -y yum-utils

Add yum source
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Update yum index
sudo yum makecache fast

Install docker-ce
sudo yum install docker-ce

启动 docker
sudo systemctl start docker

Verify that the installation was successful
sudo docker info

How to use the Docker accelerator
for users with Docker client version greater than 1.10
You can use the accelerator by modifying the daemon configuration file /etc/docker/daemon.json:

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://w5z91a3d.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324438788&siteId=291194637