安装相关包
先更新一下软件源库信息
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
添加软件仓库
官方仓库
# 添加 Docker 官方的 GPG 密钥(为了确认所下载软件包的合法性,需要添加软件源的 GPG 密钥)
curl -fsSL https://download.docker.com/linux/ubuntu