ubuntu中如何安装docker

本文发布日期:23-05-27 00:01:27  浏览次数:137

在Ubuntu中安装Docker的步骤如下:

  1. 打开终端,更新本地软件包索引:

    sudo apt-get update
  2. 安装依赖包使得 apt 能够通过 HTTPS 使用存储库 :

    sudo apt-get 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 的稳定版存储库:

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

    sudo apt-get update
  6. 安装最新版本的 Docker:

    sudo apt-get install docker-ce
  7. 安装完成后检查是否成功安装:

    sudo docker run hello-world

    如果一切正常会输出"Hello from Docker!"等信息。
    file


发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注