删除本机中的Docker
sudo apt remove -y docker docker-engine docker.io containerd runc
安装Docker
apt update
apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common sudo
curl -fsSL https://download.docker.com/linux/debian/gpg |sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
## 国内
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/debian/gpg |sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
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
## 国内
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list
apt update
安装 Docker
apt install -y docker-ce docker-ce-cli containerd.io
systemctl enable docker
systemctl status docker
非root用户运行docker
sudo groupadd docker
sudo useradd -m -s /bin/bash bbhsky
sudo usermod -aG docker bbhsky