参考文章:
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
来源:CSDN
作者:bluewelkin
链接:https://blog.csdn.net/bluewelkin/article/details/104283182