当前位置 主页 > 服务器问题 > win服务器问题汇总 >

    在Ubuntu18.04上安装Docker CE的方法(社区版)

    栏目:win服务器问题汇总 时间:2020-01-26 21:19

    卸载旧版本

    如果之前安装旧版本,需要先卸载:

    $ sudo apt-get remove docker docker-engine docker.io containerd runc

    设置仓库

    更新apt包索引:

    $ sudo apt-get update

    apt能通过HTTPS使用仓库:

    $ sudo apt-get install \
      apt-transport-https \
      ca-certificates \
      curl \
      software-properties-common

    添加官方的GPG 密钥:

    $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

    验证你的密钥:

    $ sudo apt-key fingerprint 0EBFCD88

    设置选用哪个版本。

    $ sudo add-apt-repository \
      "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
      $(lsb_release -cs) \
      test"

    我选用了test版本。

    安装

    更新apt包索引

    $ sudo apt-get update

    开始安装

    $ sudo apt-get install docker-ce docker-ce-cli containerd.io

    测试

    $ sudo docker run hello-world

    参考

    Get Docker Engine - Coummuntiy for Ubuntu

    以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持IIS7站长之家。