1.安装软件源
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
2.导入源仓库的 GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
3.将 Docker APT 软件源添加到你的系统
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
4.更新源软件包
sudo apt update
5.安装最新版docker
sudo apt install docker-ce docker-ce-cli containerd.io
6.查看docker状态
systemctl status docker