以root权限执行

# 
# 清理

apt remove docker docker-engine docker.io containerd runc
apt-get purge docker docker-engine docker.io docker-ce docker-ce-cli contained.io containerd runc docker-compose docker-compose-pulgin
rm -rf /etc/docker /usr/libexec/docker /var/lib/docker /var/lib/containerd
rm -rf /etc/apt/keyrings/docker.gpg

# 配置

curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg    
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.aliyun.com/docker-ce/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list
chmod a+r /etc/apt/keyrings/docker.gpg 

# 安装

apt update
# 以下2选1 
apt install docker-ce
apt install docker-compose