Podman镜像加速

3,859 阅读1分钟

Podman镜像加速

Podman的镜像配置存放在

  • /etc/containers/registries.conf
  • ~/.config/containers/registries.conf(默认不存在,手动创建)

国内镜像

国内可用的加速镜像:

  1. 网易云 hub-mirror.c.163.com
  2. 阿里云,需要登录账号,按步骤:
    点击 管理控制台-左侧镜像工具-镜像加速器-复制加速器地址
    得到地址:xxxxxxxx.mirror.aliyuncs.com (xx代表分配个人的地址)

配置

在 registries.conf 文件后添加:

[[registry]]
prefix = "docker.io/library"
location = "hub-mirror.c.163.com/library"

多个源配置:

[[registry]]
location = "docker.io/library"

[[registry.mirror]]
location = "hub-mirror.c.163.com/library"

[[registry.mirror]]
location = "xxxxxxxx.mirror.aliyuncs.com/library"

上面请求顺序为 :

  1. hub-mirror.c.163.com/library
  2. xxxxxxxx.mirror.aliyuncs.com/library
  3. docker.io/library

参考