podman pull或者push http镜像遇到http: server gave HTTP response to HTTPS client

原因:Docker自从1.3.X之后docker registry交互默认使用的是HTTPS,但是搭建私有镜像默认使用的是HTTP服务,所以与私有镜像交时出现以上错误

解决方案:

#增加以下配置 

vi /etc/containers/registries.conf

[[registry]] 
location = "192.168.240.99:5000" #你的仓库地址 
insecure = true #允许http

配置成功效果如下:

推送镜像到仓库:

podman push 192.168.240.99:5000/demo-tan:latest

查看仓库

curl http://192.168.240.99:5000/v2/_catalog

docker仓库源配置

unqualified-search-registries = ["docker.io"] 
[[registry]] 
insecure = true 
prefix = "docker.io" 
#location = "3ad96kxd.mirror.aliyuncs.com" 
location= "docker.io" 
[[registry.mirror]] 
location = "hub-mirror.c.163.com" 
[[registry.mirror]] 
location = "registry.docker-cn.com" 
[[registry]] 
location = "192.168.240.99:5000" 
insecure = true

tips:配置文件有两种版本格式,v1和v2,两种格式的配置不能混用,混用会提示错误。

这种是v1写法,centos9 是v2,按照上面写法即可

混写报错如下

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值