Docker installation
1. Uninstall the previous Docker
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
Copy the code
2. Install dependencies
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
Copy the code
3. Set the Yum location of the Docker repo
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
Copy the code
4. Install docker-CE (Community edition), docker-CLI
sudo yum -y install docker-ce docker-ce-cli containerd.io
Copy the code
5. Configure Aliyun image acceleration
-
Official mirror acceleration instructions
-
View the address of the mirror service itself
Just copy and paste it
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://xxxxx(own mirror accelerated connection).mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
Copy the code
6. Start Docker and set Docker to start after startup
systemctl enable docker
Copy the code