1. 下载docker 离线安装包
    可在此页面下载,https://download.docker.com/linux/static/stable/x86_64/
  2. 解压docker
    tar -zxvf docker.tar.gz
  3. 添加系统服务
    vim /etc/systemd/system/docker.service
    输入以下内容
    [Unit]
    Description=Docker Application Container Engine
    Documentation=https://docs.docker.com
    After=network-online.target firewalld.service
    Wants=network-online.target
    [Service]
    Type=notify
    ExecStart=/usr/bin/dockerd
    ExecReload=/bin/kill -s HUP $MAINPID
    LimitNOFILE=infinity
    LimitNPROC=infinity
    TimeoutStartSec=0
    Delegate=yes
    KillMode=process
    Restart=on-failure
    StartLimitBurst=3
    StartLimitInterval=60s
    [Install]
    WantedBy=multi-user.target

    添加可执行权限
    chmod +x /etc/systemd/system/docker.service

  4. 启动服务并添加开机自启动
    启动服务
    systemctl start docker
    开机自启动
    systemctl enable docker