一、安裝依賴
sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
二、配置源
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
三、安裝docker
apt list -a docker-ce ## 檢視 Docker 軟體源中所有可用的版本
sudo apt install docker-ce=<VERSION> docker-ce-cli=<VERSION> containerd.io