Ubuntu18.04 安装 Docker CE 的方法

导读这篇文章主要介绍了在Ubuntu18.04上安装Docker CE的方法(社区版),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧。
卸载旧版本

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

$ 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
参考

https://docs.docker.com/engine/install/ubuntu/

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

原创文章,作者:kepupublish,如若转载,请注明出处:https://blog.ytso.com/123243.html

(0)
上一篇 2021年8月29日
下一篇 2021年8月29日

相关推荐

发表回复

登录后才能评论