下载解压 Docker rpm 并离线安装

    1. cd /tmp/
    2. curl -O http://pan.kuaicdn.cn:800/%E7%B3%BB%E7%BB%9F%E9%95%9C%E5%83%8F/docker/docker-ce-20.10.5.tar.gz
    3. tar zxvf docker-ce-20.10.5.tar.gz
    4. rm -rf /etc/yum.repos.d/docker-ce.repo
    5. yum localinstall /tmp/docker-ce/*.rpm -y

    配置并启动 Docker

    1. usermod -aG docker root
    2. mkdir -p /etc/docker
    3. cat >/etc/docker/daemon.json <<EOF
    4. {
    5. "registry-mirrors": [
    6. "https://bn4ll166.mirror.aliyuncs.com"
    7. ],
    8. "data-root": "/data/docker-root",
    9. "dns": [
    10. "223.5.5.5",
    11. "119.29.29.29"
    12. ],
    13. "bip": "172.31.255.254/16",
    14. "storage-driver": "overlay2",
    15. "storage-opts": [
    16. "overlay2.override_kernel_check=true"
    17. ],
    18. "userland-proxy": false,
    19. "log-driver": "json-file",
    20. "log-opts": {
    21. "max-size": "50m",
    22. "max-file": "1"
    23. }
    24. }
    25. EOF
    26. systemctl daemon-reload
    27. systemctl enable docker
    28. systemctl restart docker