Docker第一篇

回眸只為那壹抹淺笑 提交于 2020-02-12 19:52:45

参考文章:

https://www.cnblogs.com/yaoczz/p/11047041.html

一、

 

二、Step2 安装Docker镜像

备用方式1> 安装国内阿里Docker CE镜像[国内推荐]

curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

 

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

通过搜索密钥的最后8个字符,确认您现在已经拥有指纹 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 的密钥。

三、Step3. 安装稳定版的repository

方式1> 阿里repository[国内推荐]

 

如何搜索apt-key list 找到最下面,发现一样的

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

四、安装Docker CE

方式1) 安装最新版Docker CE

$ sudo apt-get update
$ sudo apt-get install docker-ce

如果使用国外官方镜像,可能存在以下问题:
update更新时间过长,一直卡住不动,形如:

$ sudo apt-get update
Hit:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
Hit:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
Hit:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
Hit:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
0% [Working] 

或是

  Could not resolve host: download.docker.com
Reading package lists... Done
W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/xenial/InRelease  Could not resolve host: download.docker.com

或是

Err:5 https://download.docker.com/linux/ubuntu xenial InRelease
  Operation timed out after 0 milliseconds with 0 out of 0 bytes received
Reading package lists... Done
W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/xenial/InRelease  Operation timed out after 0 milliseconds with 0 out of 0 bytes received

方式2) 安装指定版本Docker CE

# 获取可用版本
$ apt-cache madison docker-ce
# 安装指定版本
$ sudo apt-get install docker-ce=<VERSION>
例如: 
$ sudo apt-get install docker-ce=17.06.2~ce-0~ubuntu 

 

参考文章二:https://www.cnblogs.com/hupeng1234/p/9773770.html 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!