官方文档:
https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository
1,更新下sudo apt-get update
2,安装包以允许apt
通过HTTPS使用存储库:
sudo apt-get install
apt-transport-https
ca-certificates
curl
software-properties-common
3,添加Docker的官方GPG密钥:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
验证下指纹:
sudo apt-key fingerprint 0EBFCD88
![](https://img2018.cnblogs.com/blog/1369915/201812/1369915-20181226111045831-1128813908.png)
sudo add-apt-repository
"deb [arch=amd64] https://download.docker.com/linux/ubuntu
$(lsb_release -cs)
stable"
安装DOCKER CE
-
更新
apt
包索引。$ sudo apt-get update
正式安装:
安装最新版本的Docker CE,或转到下一步安装特定版本:
sudo apt-get install docker-ce