Docker 被Ban了?Docker 安装慢?试试这个

已Ubuntu为例 Docker 安装文档 docker

1、按照文档执行

for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

2、下一步部需要把命令里的docker域名替换为其他镜像源,我这里用清华大学的 镜像

  • 把命令里的域名 https://download.docker.com/ 替换为 https://mirrors.tuna.tsinghua.edu.cn/docker-ce/
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

3、剩下的步骤和安装文档里一样了

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker run hello-world
本作品采用《CC 协议》,转载必须注明作者和本文链接
讨论数量: 1

推荐linuxmirrors.cn/other/#docker-%E5%...

bash <(curl -sSL https://linuxmirrors.cn/docker.sh)
5个月前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!