Centos7 quick installation of docker and configuration of image acceleration

follow the official documentation step by step

https://docs.docker.com/engine/install/centos/

1: uninstall the old version

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

2: download docker dependent packages and configure docker warehouse address

 sudo yum install -y yum-utils
 sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

3: install docker’s engine, operate docker’s client, and its container

sudo yum install docker-ce docker-ce-cli containerd.io

after the execution of the installation is complete

start docker command:

sudo systemctl start docker

set docker startup:

sudo systemctl enable docker

view docker version:

docker -v

view docker image:

sudo docker images

configure image acceleration: configure ali cloud

1: create directory

sudo mkdir -p /etc/docker

2: configure the mirror accelerator address

sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://17o3zxc0.mirror.aliyuncs.com"]
}
EOF

3: restart docker background thread

sudo systemctl daemon-reload

4: restart docker service

sudo systemctl restart docker


Read More: