参考https://docs.docker.com/install/linux/docker-ce/ubuntu/
1.更新源列表:
sudo apt-get update
2.sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
3.Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
4.验证指纹
sudo apt-key fingerprint 0EBFCD88
结果如图说明成功:
5.添加docker仓库
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
6.更新
sudo apt-get update
7.安装
sudo apt-get install docker-ce
8.测试
sudo docker run hello-world
结果如图说明成功: