mac系统podman连接私服harbor

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

希望能帮助到需要的朋友。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值