由于众所周知的原因,国内的网络已经没办法直连 docker hub 及 docker 相关的服务,导致国内的机器没有办法安装 docker 和从 docker 镜像仓拉取镜像。网上搜了一圈发现了可以有效安装 docker 的方法,因此记录一下。
安装
安装镜像源
|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1 2 3 4 5 6 7 8 9 10 11 12 | # https://developer.aliyun.com/article/110806 sudo apt-get update sudo apt-get install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/debian/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://mirrors.aliyun.com/docker-ce/linux/debian \ (. /etc/os-release && echo "VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null |
安装docker-ce
|-----|------------------------------------------------------------------------------------------------------------------------------|
| 1 2 | sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y |