Harbor安装、HTTPS配置、修改端口后不可访问?

Harbor安装、HTTPS配置、修改端口后不可访问?

大家好,我是秋意零。今天分享Harbor相关内容,安装部分可完全参考官方文档,写的也比较详细。

安装Harbor

官方文档:https://goharbor.io/docs/2.12.0/install-config/

参考:https://blog.csdn.net/qq359605040/article/details/129025958

配置Harbor仓库HTTPS协议

官方文档:https://goharbor.io/docs/2.12.0/install-config/configure-https/

参考:https://blog.csdn.net/networken/article/details/107502461

修改Harbor端口后不可访问?

修改端口

1)编辑harbor.yml配置文件,修改对应端口

bash 复制代码
vim harbor.yml

2)修改配置后,执行prepare脚本重新生成配置

bash 复制代码
./prepare

3)重启Harbor

bash 复制代码
docker compose down && docker compose up -d

报错信息

修改端口后,命令行登录Harbor报错:tls: failed to verify certificate: x509: certificate signed by unknown authority

1)docker login

bash 复制代码
docker login -u admin -p Harbor12345 https://registry.xxxxx.com:8443

2)nerdctl login

bash 复制代码
nerdctl -n k8s.io login -u admin -p Harbor12345 registry.xxxxxx.com:8443

操作处理

1)docker login

/etc/docker/certs.d/Docker 的配置目录,用于管理私有镜像仓库的证书或信任配置。

它确保 docker CLI 或 dockerd 守护进程在与镜像仓库通信时能够正确处理 HTTPS 请求。

bash 复制代码
mv /etc/docker/certs.d/registry.xxxxxx.com/ /etc/docker/certs.d/registry.xxxxxx.com:8443/
systemctl restart docker
docker login -u admin -p Harbor12345 https://registry.xxxxxx.com:8443

2)nerdctl login

/etc/containerd/certs.d/containerd 的配置目录,用于配置私有镜像仓库的 TLS 证书或信任配置。

它主要用于确保在使用 containerd 拉取或推送镜像时,正确处理 HTTPS 连接的安全性。

bash 复制代码
$ cat /etc/containerd/certs.d/registry.xxxxxx.com/hosts.toml
[host."https://registry.xxxxxx.com:8443"] # 修改此处 添加端口号
  capabilities = ["pull", "resolve", "push"]
  skip_verify = true
  
$ mv /etc/containerd/certs.d/registry.xxxxxx.com/ /etc/containerd/certs.d/registry.xxxxxx.com:8443
$ systemctl restart containerd

END

相关推荐
星寂樱易李34 分钟前
Ubuntu 18.04 iso文件下载
linux·运维·ubuntu
羑悻的小杀马特2 小时前
【Linux篇章】Linux 进程信号2:解锁系统高效运作的 “隐藏指令”,开启性能飞跃新征程(精讲捕捉信号及OS运行机制)
linux·运维·服务器·学习·os·进程信号
爬树的小蚂蚁4 小时前
Linux 修改bond后网关不生效的问题
linux·运维·服务器
爆农9 小时前
centos搭建dokcer和vulhub
linux·运维·centos
chenxy029 小时前
如何快速分享服务器上的文件
运维·服务器
o0o_-_10 小时前
【瞎折腾/mi50 32G/ubuntu】mi50显卡ubuntu运行大模型开坑(三)安装风扇并且控制转速
linux·运维·ubuntu
SuperW11 小时前
Linxu实验五——NFS服务器
运维·服务器
promise52411 小时前
JVM之jcmd命令详解
java·linux·运维·服务器·jvm·bash·jcmd
Bruce_Liuxiaowei11 小时前
Day 5:Warp高级定制与自动化
运维·warp
溜达的大象12 小时前
docker创建一个centOS容器安装软件(以宝塔为例)的详细步骤
运维·docker·容器