下载
中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助
昇腾小AI

部署Docker(Ubuntu)

前提条件

  • 请检查在“/etc/apt/sources.list”文件中的源是否正确,如果没有配置源,请配置可用的源。
  • 用户也可以登录源链接,根据现场操作系统架构和版本,进入对应操作系统目录,单击打开“source.list”文件,将文件内源链接复制到服务器“/etc/apt/sources.list”文件中,要包含Docker-ce相关的源,如“deb https://mirrors.huaweicloud.com/docker-ce/linux/ubuntu/focal stable”

安装Docker

  1. root用户登录服务器,配置信任Docker的GPG公钥,命令如下:
    curl -fsSL https://repo.huaweicloud.com/docker-ce/linux/debian/gpg | sudo apt-key add -
  2. 执行以下命令,更新源并安装Docker。
    apt-get update 
    apt-get install -y docker-ce

    如果执行apt-get update命令时,出现类似如下所示报错,则执行apt-get update --allow-unauthenticated命令。

    Err:1 https://repo.huaweicloud.com/docker-ce/linux/ubuntu focal InRelease  Temporary failure resolving 'repo.huaweicloud.com'
    Err:2 https://mirrors.huaweicloud.com/ubuntu-ports focal InRelease  Temporary failure resolving 'mirrors.huaweicloud.com'
    Err:3 https://mirrors.huaweicloud.com/ubuntu-ports focal-updates InRelease Temporary failure resolving 'mirrors.huaweicloud.com'
    Err:4 https://mirrors.huaweicloud.com/ubuntu-ports focal-security InRelease Temporary failure resolving 'mirrors.huaweicloud.com'
    Err:5 https://mirrors.huaweicloud.com/docker-ce/linux/ubuntu focal InRelease Temporary failure resolving 'mirrors.huaweicloud.com'
    Reading package lists... Done
    N: Ignoring file 'index.html' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
    W: Failed to fetch https://mirrors.huaweicloud.com/ubuntu-ports/dists/focal/InRelease  Temporary failure resolving 'mirrors.huaweicloud.com'
    W: Failed to fetch https://mirrors.huaweicloud.com/ubuntu-ports/dists/focal-updates/InRelease  Temporary failure resolving 'mirrors.huaweicloud.com'
    W: Failed to fetch https://mirrors.huaweicloud.com/ubuntu-ports/dists/focal-security/InRelease  Temporary failure resolving 'mirrors.huaweicloud.com'
    W: Failed to fetch https://mirrors.huaweicloud.com/docker-ce/linux/ubuntu/dists/focal/InRelease  Temporary failure resolving 'mirrors.huaweicloud.com'
    W: Failed to fetch https://repo.huaweicloud.com/docker-ce/linux/ubuntu/dists/focal/InRelease  Temporary failure resolving 'repo.huaweicloud.com'
    W: Some index files failed to download. They have been ignored, or old ones used instead.
  3. 执行systemctl start docker命令启动Docker。
  4. 执行docker version命令,如回显类似以下信息表示Docker已安装并启动。
    Client: Docker Engine - Community
     Version:           20.10.7
     API version:       1.41
     Go version:        go1.13.15
     Git commit:        f0df350
     Built:             Wed Jun 30 19:55:49 2021
     OS/Arch:           linux/amd64
     Context:           default
     Experimental:      true
    
    Server: Docker Engine - Community
     Engine:
      Version:          20.10.7
      API version:      1.41 (minimum version 1.12)
      Go version:       go1.13.15
      Git commit:       b0f5bc3
      Built:            Wed Jun 30 19:54:13 2021
      OS/Arch:          linux/amd64
      Experimental:     false
     containerd:
      Version:          1.4.9
      GitCommit:        e25210fe30a0a703442421b0f60afac609f950a3
     runc:
      Version:          1.0.1
      GitCommit:        v1.0.1-0-g4144b63
     docker-init:
      Version:          0.19.0
      GitCommit:        de40ad0
搜索结果
找到“0”个结果

当前产品无相关内容

未找到相关内容,请尝试其他搜索词