1. 配置 yum 源:
    yum -y install yum-utils

    yum-config-manager \
    --add-repo \
    http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
  2. 安装:
    yum -y install docker-ce-20.10.17-3.el7 docker-ce-cli-20.10.17-3.el7

  1. 启动:
    systemctl start docker && systemctl enable docker

  2. 配置 docker 镜像仓库:
    vim /etc/docker/daemon.json

     {
          "registry-mirrors": [
              "https://docker.mirrors.ustc.edu.cn",
              "https://hub-mirror.c.163.com",
              "https://mirror.baidubce.com",
              "https://reg-mirror.qiniu.com"
          ],
          "exec-opts": ["native.cgroupdriver=systemd"]
     }
  3. 重启 docker,使镜像仓库生效:
    systemctl restart docker

文档更新时间: 2024-04-20 10:57   作者:lee