当前位置: 首页 > news >正文

podman/docker国内可用的docker镜像源(2025-05)

一、添加Docker国内镜像

1、修改 /etc/docker/daemon.json

设置 registry mirror,具体命令如下:

sudo vim /etc/docker/daemon.json <<EOF
{"registry-mirrors": ["https://docker.1ms.run","https://docker.xuanyuan.me","https://hub.rat.dev","https://docker.1panel.live"]
}
EOF

2、重启docker:

systemctl daemon-reload
systemctl restart docker

二、添加Podman国内镜像

1、修改 /etc/containers/registries.conf.d/999-podman-machine.conf

999-podman-machine.conf 这个文件名字可能每台机子有自己的名称,可以在路径下找到自己的名字。

设置 registry mirror,具体命令如下:

# enter into the podman virtual machine
podman machine ssh# change the podman registries
sudo vi /etc/containers/registries.conf.d/999-podman-machine.conf# ----------contents as follows -----------------unqualified-search-registries = ["docker.io"][[registry]]prefix = "docker.io"location = "docker.1ms.run"[[registry]]prefix = "docker.io"location = "hub.rat.dev"[[registry]]prefix = "docker.io"location = "docker.xuanyuan.me"[[registry]]prefix = "docker.io"location = "docker.1panel.live"                                                                                     

 我的环境时windows11下的podman,所以需要podman machine,纯linux环境可以跳过podman machine这步。

2. 重新podman machine

podman machine stoppodman machine start

3. 测试是否成功

podman pull docker.1ms.run/library/hello-world

 Trying to pull docker.1ms.run/library/hello-world:latest...
Getting image source signatures
Copying blob sha256:e6590344b1a5dc518829d6ea1524fc12f8bcd14ee9a02aa6ad8360cce3a9a9e9
Copying config sha256:74cc54e27dc41bb10dc4b2226072d469509f2f22f1a3ce74f4a59661a1d44602
Writing manifest to image destination
74cc54e27dc41bb10dc4b2226072d469509f2f22f1a3ce74f4a59661a1d44602

输出所示,表示registry配置成功。

三、docker/podman search 镜像名 报错时

通过docker/podman search 镜像名 不能查找的时候,通常报错:Get "https://index.docker.io/v2/" ...timeout.

 podman search hello-world
Error: 2 errors occurred:
        * couldn't search registry "docker.io": pinging container registry index.docker.io: Get "https://index.docker.io/v2/": dial tcp 202.160.130.52:443: i/o timeout
        * couldn't search registry "xuanyuan.me": pinging container registry xuanyuan.me: StatusCode: 404, "<html>\r\n<head><title>404 Not Found</title></head>\r..."

可以尝试来网站上手动查找自己需要的镜像,然后使用pull命令+镜像限定名称获得。

https://docker.1ms.run

首页 - 毫秒镜像

https://docker.xuanyuan.me

DockerHub镜像加速器 - 免费Docker镜像源国内加速 - DockerHub加速国内解决方案

相关文章:

  • Linux btop 使用教程
  • Wireshark抓取SMTP协议报文
  • 如何提升自我执行力?
  • Linux51 安装baidunetdisk yum install rpm -ivh
  • 中科院:通过内部表示优化LLM上下文利用
  • 图解 Git 工作流:理解 Rebase、Merge 与 Pull Request 的区别
  • 21 课时精通生成式 AI:微软官方入门指南详解
  • 【设计模式】GoF设计模式之备忘录模式(Memento Pattern)
  • LTspice
  • 【软件设计师:复习】上午题核心知识点总结(二)
  • 大模型蒸馏技术
  • 【业务领域】电脑主板芯片电路结构
  • (持续更新)Ubuntu搭建LNMP(Linux + Nginx + MySQL + PHP)环境
  • 网络安全知识问答微信小程序的设计与实现
  • ProCCD:复古CCD相机应用,重现经典胶片感
  • Java 进阶--集合:告别数组的“僵硬”,拥抱灵活的数据容器
  • VSCode开发调试Python入门实践(Windows10)
  • C#实现主流PLC读写工具类封装
  • 报错:函数或变量 ‘calcmie‘ 无法识别。
  • 【Linux】环境基础开发工具使用
  • 香港发生车祸致22人受伤,4人伤势严重
  • 武汉大学新闻与传播学院已由“80后”副院长吴世文主持工作
  • 上海:以税务支持鼓励探索更多的创新,助力企业出海
  • 金砖国家外长会晤主席声明(摘要)
  • 来论|受美国“保护”,日本民众要付出什么代价?
  • 海口市政协党组成员、秘书长、机关党组书记汪娟被查