1. 更新系统包索引
    sudo apt update
  2. 安装一些必要的包,以便于后续添加 apt 仓库:
    sudo apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
  3. 添加阿里云密钥
    添加 GPG 密钥是为了确保软件包的安全性和完整性,避免安装过程中的潜在问题。建议尽量执行这一步,以确保安装过程顺利进行。
    curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/debian/gpg | sudo apt-key add -
  4. 设置阿里云docker仓库
    sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/debian $(lsb_release -cs) stable"
  5. 再次更新下系统包的索引
    sudo apt update
  6. 安装docker 
    sudo apt install -y docker-ce
  7. 启动并设置docker的开机自启动
    sudo systemctl start docker
    sudo systemctl enable docker
  8. 查看下docker是否安装成功
    sudo docker version
  9. 最后配置docker的镜像加速推荐阿里云的网址
    详细的操作网站会写出来
    阿里云docker镜像加速
    (如果没有阿里云的账号,可以参考这篇博客的内容docker pull 的解决办法
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐