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"
  ]
}
相关推荐
IT策士42 分钟前
Docker 常见面试问题
docker·容器·面试
预测模型的开发与应用研究1 小时前
双Docker Oracle XE 跨库查询操作文档
docker·oracle·容器
逻极1 小时前
Docker容器化实战:从镜像构建到微服务编排与避坑指南
docker·容器·镜像·devops
鹤落晴春2 小时前
【K8s】资源配额与访问控制
docker·容器·kubernetes
我叫张小白。2 小时前
Docker核心命令
运维·docker·容器
一只积极向上的小咸鱼2 小时前
Codex MCP 与 Skills 跨 Docker 共享问题总结与后续规范
运维·docker·容器
暮云星影12 小时前
个人总结 搭建Docker监控
docker·容器·grafana·prometheus
维度攻城狮14 小时前
在Vscode连接的Docker容器中使用codex,并配置DeepSeek模型
vscode·docker·codex
l1t17 小时前
DeepSeek总结的使用 Docker 对 PostgreSQL 进行 Beta 测试
docker·postgresql·容器
暮云星影1 天前
个人总结 docker 常用命令
docker·容器