https://docs.docker.com/install/linux/docker-ce/centos/

https://yq.aliyun.com/articles/110806

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# centos

# uninstall old version
sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-selinux \
                  docker-engine-selinux \
                  docker-engine

# install from repo
# step 1: 安装必要的一些系统工具
sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2
# Step 2: 添加软件源信息
sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
# Step 3: 更新并安装 Docker-CE
sudo yum install docker-ce docker-ce-cli containerd.io
# Step 4: 开启Docker服务

sudo systemctl start docker
sudo systemctl enable docker

https://yq.aliyun.com/articles/110806