sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg2 sudo
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
成功后,命令将返回OK。失败了输入下面这个。
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/debian $(lsb_release -cs) stable"
$(lsb_release -cs)将返回Debian发行版的名称。在这种情况下,就是这样buster。
sudo apt update
sudo apt install docker-ce
sudo systemctl status docker