sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
apt-get update -y
apt install python2 -y
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
apt remove docker docker-engine docker.io containerd runc
apt-get install ca-certificates curl gnupg lsb-release -y
mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
或者
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
或者
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update -y
chmod a+r /etc/apt/keyrings/docker.gpg
apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
curl -SL https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose