卸载旧版本
sudo apt-get remove docker docker-engine docker.io containerd runc
安装
- 更新包索引
sudo apt-get update
- 安装可以通过https使用仓库的一些相关包
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
- 添加GPG key
curl -fsSL https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
- 验证指纹
sudo apt-key fingerprint 0EBFCD88
应该得到如下内容
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) <docker@docker.com>
sub rsa4096 2017-02-22 [S]
- 添加docker-ce的仓库
sudo add-apt-repository \
"deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \
$(lsb_release -cs) \
stable"
- 更新包索引
sudo apt-get update
- 安装docker
sudo apt-get install docker-ce docker-ce-cli containerd.io
网友评论