卸载docker 旧版本

 sudo apt-get remove docker docker-engine docker.io containerd runc

安装docker 存储库

sudo apt-get update
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

添加docker 官方的GPG密钥

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

设置docker 存储库(x86_64/amd64)

 echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

安装docker 引擎

更新Debianapt包,安装最新版本的docker 引擎

 sudo apt-get update
 sudo apt-get install docker-ce docker-ce-cli containerd.io

……

等待3分钟

安装成功

image.png

Q.E.D.