美文网首页
在 Ubuntu 20.04 上安装 Docker

在 Ubuntu 20.04 上安装 Docker

作者: 随遇而安_cc | 来源:发表于2024-05-27 10:16 被阅读0次

要在 Ubuntu 20.04 上安装 Docker,可以按照以下步骤进行操作:

  1. 更新 apt 软件包索引:

    sudo apt update
    
  2. 安装依赖软件包,以允许 apt 使用 HTTPS 仓库:

    sudo apt install apt-transport-https ca-certificates curl software-properties-common
    
  3. 添加 Docker 的官方 GPG 密钥:

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    
  4. 添加 Docker APT 仓库到你的系统:

    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    
  5. 再次更新 apt 软件包索引:

    sudo apt update
    
  6. 确保安装从 Docker APT 仓库而不是默认的 Ubuntu 仓库:

    apt-cache policy docker-ce
    
  7. 最后,安装 Docker:

    sudo apt install docker-ce
    
  8. 验证 Docker 是否安装成功,可以运行以下命令:

    sudo docker --version
    

恭喜,现在 Docker 已经安装在你的 Ubuntu 20.04 系统上了。接下来你就可以开始使用 Docker 来构建和运行容器化的应用程序了。

相关文章

网友评论

      本文标题:在 Ubuntu 20.04 上安装 Docker

      本文链接:https://www.haomeiwen.com/subject/uzpcqjtx.html