按照官方網站提示安裝報錯:
E: Unable to locate package docker-engine
解決辦法:
新增源:
echo "deb [arch=$(dpkg --print-architecture)] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list
deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal stable
新增金鑰
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
安裝:
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin