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

podman pull或者push http镜像遇到http: server gave HTTP response to HTTPS client_第1张图片

查看仓库

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,按照上面写法即可

混写报错如下

你可能感兴趣的:(docker,podman,私有仓库)