根据docker官网安装文档整理
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y
apt-get -y install curl
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce -y
docker --version
systemctl start docker
systemctl enable docker
参考资料:
https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository
注:大陆地区可能下载失败。