Podman添加私有镜像源配置 registries.conf

配置文件路径 /etc/containers/registries.conf

Podman 3.0.0+版本配置文件格式发生了变化,最显著的是现在默认会有一条 unqualified-search-registries = ["docker.io", "quay.io"]

按照如下格式添加镜像:

[[registry]]
prefix = "192.168.0.1:7000"
location = "192.168.0.1:7000"
insecure = true

其中prefix是pull的时候指定的镜像前缀,location是获取镜像的地址,如果不指定prefix则默认和location一致。insecure=true表示允许通过HTTP协议来获取镜像,对于私有化部署/内网测试环境下无https证书的环境来说很有帮助。

如果配置错误可能会出现以下错误提示:

Error: error getting default registries to try: error loading registries configuration "/etc/containers/registries.conf": toml: cannot load TOML value of type map[string]interface {} into a Go slice

Error: error getting default registries to try: error loading registries configuration "/etc/containers/registries.conf": toml: cannot load TOML value of type []map[string]interface {} into a Go boolean

 

Podman 3.0之前配置文件格式如下:

[registries.search]
registries = ['docker.io']
[registries.insecure]
registries = ['192.168.0.1:7000']

其中registries.search与新版unqualified-search-registries含义相同,registries.insecure表示这些registry允许不安全的HTTP拉取

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值