CentOS7 install Docker and set up Alibaba Cloud acceleration

CentOS7 install Docker and set up Alibaba Cloud acceleration

1. Download the repo of docker-ce

sudo curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo

2. Installation dependencies

yum install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm

3. Install docker-ce

sudo yum install docker-ce docker-ce-cli -y

4. Set docker to boot

sudo systemctl enable docker

Of course, you can also disable and start docker when needed

5. Manually start docker

sudo systemctl start docker

6. Check if docker can start correctly

sudo docker version

If the version information can be displayed, the installation and startup are correct

7. Set up Alibaba Cloud acceleration

Create/modify daemon configuration file/etc/docker/daemon.json

Log in to Alibaba Cloud and enter the container mirroring service address :https://cr.console.aliyun.com/cn-hangzhou/instances/repositories

Insert picture description here
Everyone’s accelerator address is different

sudo tee /etc/docker/daemon.json <<-'EOF'
{
    
    
  "registry-mirrors": ["https://你的镜像加速地址.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

View

docker info

You can see your mirror counter address, then the setting is successful.
Insert picture description here

Follow the steps written above to configure the mirror accelerator

Guess you like

Origin blog.csdn.net/qq_27198345/article/details/109593484