Ubuntu系统下安装docker

在刚工作之后,了解到了docker。通过docker来生成镜像,在经过学习使用之后,进行总结。

Ubuntu系统下安装docker的步骤:

  1. 更新apt包的索引 , 第一次更新的时候,可能会稍微慢一些。
$ sudo apt-get update
  1. 安装一些包来使得apt 可以通过HTTPS来使用存储库
$ sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
  1. 添加 Docker 官方的GPG密钥
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  1. 设置stable 存储库
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  1. 关闭终端重新打开更新索引包
$ sudo apt-get update
  1. 安装 Docker CE ,这次安装需要一定的时间
$ sudo apt-get install -y docker-ce
  1. 查看安装版本确定是否安装成功
$ docker -v
发布了106 篇原创文章 · 获赞 46 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/zlq_CSDN/article/details/97532749