配置文件优先级
- /usr/share/containers
- /etc/containers
- ~/.config/containers
配置镜像源
sudo vi /etc/containers/registries.conf
# 如果直接使用 podman pull ubuntu 时,没有明确指明仓库的时候,使用以下配置的仓库顺序去获取
unqualified-search-registries = ["registry.docker-cn.com", "docker.io", "quay.io", "registry.access.redhat.com"]
# 配置镜像仓库的具体设置
# [[registry]]
# 前缀用于构建完整的镜像名称,当镜像名称没有包含完整域名时,不设置时与location相同
# prefix = "docker.io"
# 位置是镜像仓库的完整地址(加速器地址)
# location = "docker.io"
# 可选的配置项,例如是否启用该仓库
# mirror-by-default = false
# 可选的配置项,指定该仓库的权重,用于决定搜索时的优先级
# priority = 1
# 允许通过http协议获取镜像
# insecure = true
# 默认镜像仓库地址
[[registry]]
prefix = "docker.io"
location = "registry.docker-cn.com"
insecure = true
# 备用镜像仓库地址
[[registry.mirror]]
location = "hub-mirror.c.163.com"
[[registry.mirror]]
location = "xxxxxx.mirror.aliyuncs.com"
# "disabling": 禁用短名称模式,允许使用短名称拉取镜像。这是默认设置。
# "enforcing": 强制要求使用完整名称拉取镜像。
# "strict-registry": 仅允许从已配置的仓库中使用短名称拉取镜像
short-name-mode="enforcing"
unqualified-search-registries = ["registry.docker-cn.com", "docker.io", "quay.io", "registry.access.redhat.com"]
[[registry]]
prefix = "docker.io"
location = "registry.docker-cn.com"
insecure = true
[[registry.mirror]]
location = "dockerproxy.com"
[[registry.mirror]]
location = "hub-mirror.c.163.com"
[[registry.mirror]]
location = "jcrvo144.mirror.aliyuncs.com"
short-name-mode="enforcing"