docker安装和换源

安装:

https://www.runoob.com/docker/ubuntu-docker-install.html

bash 复制代码
sudo apt-get remove docker docker-engine docker.io containerd runc



sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common


curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://mirrors.ustc.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

sudo apt-get install docker-ce docker-ce-cli containerd.io

apt-cache madison docker-ce

sudo apt-get install docker-ce=VERSION_STRING docker-ce-cli=VERSION_STRING containerd.io


sudo docker run hello-world

换源:

注意,因为初始的域名不可访问,所有代理没有效果,只能换源!

bash 复制代码
{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "registry-mirrors": [
    "https://docker.hpcloud.cloud",
    "https://docker.m.daocloud.io",
    "https://docker.unsee.tech",
    "https://docker.1panel.live",
    "http://mirrors.ustc.edu.cn",
    "https://docker.chenby.cn",
    "http://mirror.azure.cn",
    "https://dockerpull.org",
    "https://dockerhub.icu",
    "https://hub.rat.dev"
  ]
}
相关推荐
Sheffield4 天前
Docker的跨主机服务与其对应的优缺点
linux·网络协议·docker
Sheffield4 天前
Alpine是什么,为什么是Docker首选?
linux·docker·容器
马艳泽4 天前
win10下运行Start Broker and Proxy报错解决
docker
用户13573999256605 天前
Windows 从 0 搭建 WSL2 原生 AI 开发环境:Codex + Docker + VSCode
docker
vi_h5 天前
在 macOS 上通过 Docker 安装并运行 Ollama(详细可执行教程)
macos·docker·ollama
黑心老魔5 天前
通过 Docker 创建开发环境
docker·开发环境
冬奇Lab6 天前
一天一个开源项目(第41篇):Workout.cool - 现代化开源健身教练平台,训练计划与进度追踪
docker·开源·资讯
天朝八阿哥6 天前
使用Docker+vscode搭建离线的go开发调试环境
后端·docker·visual studio code
阿虎儿7 天前
Docker安装(非sudo用户可用)
docker
fetasty8 天前
rustfs加picgo图床搭建
docker