美文网首页
Install Docker

Install Docker

作者: D6K | 来源:发表于2017-12-28 01:51 被阅读27次

Docker主要分社区版(CE)和企业版(EE),不同版本提供的功能有所区别。


CE & EE
  1. 卸载老版本Docker
$ sudo apt-get remove docker docker-engine docker-ce docker.io
  1. 社区版CE安装准备
$ sudo apt-get install apt-transport-https ca-certificates \
 curl software-properties-common

添加GPG key

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

我安装的版本指纹是:9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88,通过后8位字符进行指纹验证。

$ sudo apt-key fingerprint 0EBFCD88
Verify key

添加源

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

更新软件索引

$ sudo apt-get update
  1. 安装Docker
$ sudo apt-get install docker-ce

安装特定版本的包

$ apt-cache madison docker-ce
搜索索引中的版本

选择安装所需版本

$ sudo apt-get install docker-ce=<VERSION>
  1. 验证安装
$ sudo docker run hello-world
  1. 更新
sudo apt-get update

安装包安装
https://download.docker.com/linux/ubuntu/dists/对应版的.deb包,手动安装。

$ sudo dpkg -i /path/to/package.deb

脚本安装

$ curl -fsSL get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh

  1. 卸载Docker
$ sudo apt-get purge docker-ce
$ sudo rm -rf /var/lib/docker

相关文章

网友评论

      本文标题:Install Docker

      本文链接:https://www.haomeiwen.com/subject/robyzttx.html