mac系统podman连接私服harbor
概要
由于公司规定不再允许使用docker destop,本人选择用podman作为替代,这里主要记录下关于mac系统如何用podman连接私服harbor(https),步骤只针对mac系统,其他系统配置文件修改会有所不同。
在没有配置registries.insecure的情况下,本地docker或者podman连接https私服都会有如下报错:
Error: authenticating creds for "host:port": pinging container registry host:port: Get "https://host:port/xx/": http: server gave HTTP response to HTTPS client
流程
第一步:
首先官网下载https://podman.io/最新的podman desktop
登录进podman desktop启动podman machine
或
执行下面命令启动podman machine
podman machine start
第二步:
进入到podman配置文件目录
cd ~
cd .config/containers
pwd
如果发现没有registries.conf,请直接创建,如果有可以直接在上面作修改或者备份当前registries.conf再进行操作
vi registries.conf
第三步:
在registries.conf添加自己的harbor私服配置
[registries.insecure]
registries=["x.xxx.xxx.xx"]
最后:
验证下是否能连上harbor
podman login host:port
连接成功
如果push的时候也遇到了http -> https的错误,请参考如下:
podman push --tls-verify=false host:port/project/image-name:tag
希望能帮助到需要的朋友。