news 2026/9/3 3:40:19

使用harbor搭建私有仓库

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
使用harbor搭建私有仓库

下载harbor:

https://github.com/goharbor/harbor/releases/download/v2.14.2-rc2/harbor-offline-installer-v2.14.2-rc2.tgz

官网:

https://github.com/goharbor/harbor

文档参考:

https://goharbor.cn/docs/2.13.0/install-config/download-installer/

确定安装好docker 和docker-composer

[root@localhost harbor]# cp harbor.yml.tmpl harbor.yml [root@localhost harbor]# vi harbor.yml [root@localhost harbor]# ./install.sh 修改yml文件 主要修改host 安装 [root@localhost harbor]# ./install.sh [Step 0]: checking if docker is installed ... Note: docker version: 29.1.4 [Step 1]: checking docker-compose is installed ... Note: Docker Compose version v5.0.1 [Step 2]: loading Harbor images ... Loaded image: goharbor/prepare:v2.14.2 Loaded image: goharbor/trivy-adapter-photon:v2.14.2 Loaded image: goharbor/harbor-core:v2.14.2 Loaded image: goharbor/harbor-db:v2.14.2 Loaded image: goharbor/harbor-jobservice:v2.14.2 Loaded image: goharbor/harbor-registryctl:v2.14.2 Loaded image: goharbor/nginx-photon:v2.14.2 Loaded image: goharbor/harbor-portal:v2.14.2 Loaded image: goharbor/redis-photon:v2.14.2 Loaded image: goharbor/registry-photon:v2.14.2 Loaded image: goharbor/harbor-log:v2.14.2 Loaded image: goharbor/harbor-exporter:v2.14.2 [Step 3]: preparing environment ... [Step 4]: preparing harbor configs ... prepare base dir is set to /root/harbor Clearing the configuration file: /config/portal/nginx.conf Clearing the configuration file: /config/log/logrotate.conf Clearing the configuration file: /config/log/rsyslog_docker.conf Clearing the configuration file: /config/nginx/nginx.conf Clearing the configuration file: /config/core/env Clearing the configuration file: /config/core/app.conf Clearing the configuration file: /config/registry/passwd Clearing the configuration file: /config/registry/config.yml Clearing the configuration file: /config/registryctl/env Clearing the configuration file: /config/registryctl/config.yml Clearing the configuration file: /config/db/env Clearing the configuration file: /config/jobservice/env Clearing the configuration file: /config/jobservice/config.yml Generated configuration file: /config/portal/nginx.conf Generated configuration file: /config/log/logrotate.conf Generated configuration file: /config/log/rsyslog_docker.conf Generated configuration file: /config/nginx/nginx.conf Generated configuration file: /config/core/env Generated configuration file: /config/core/app.conf Generated configuration file: /config/registry/config.yml Generated configuration file: /config/registryctl/env Generated configuration file: /config/registryctl/config.yml Generated configuration file: /config/db/env Generated configuration file: /config/jobservice/env Generated configuration file: /config/jobservice/config.yml copy /data/secret/tls/harbor_internal_ca.crt to shared trust ca dir as name harbor_internal_ca.crt ... ca file /hostfs/data/secret/tls/harbor_internal_ca.crt is not exist copy to shared trust ca dir as name storage_ca_bundle.crt ... copy None to shared trust ca dir as name redis_tls_ca.crt ... loaded secret from file: /data/secret/keys/secretkey Generated configuration file: /compose_location/docker-compose.yml Clean up the input dir [Step 5]: starting Harbor ... WARN[0000] No services to build [+] up 10/10 ✔ Network harbor_harbor Created 0.4s ✔ Container harbor-log Created 0.3s ✔ Container registry Created 0.5s ✔ Container harbor-portal Created 0.6s ✔ Container registryctl Created 0.6s ✔ Container harbor-db Created 0.5s ✔ Container redis Created 0.5s ✔ Container harbor-core Created 0.2s ✔ Container nginx Created 0.2s ✔ Container harbor-jobservice Created 0.2s ✔ ----Harbor has been installed and started successfully.---- [root@localhost harbor]# cat harbor.yml # Configuration file of Harbor

其实本质harbor他也是在docker容器中运行的,

访问:https://192.168.123.67/harbor/projects

默认用户名admin Harbor12345

docker login,登录成功

[root@localhost harbor]# docker login yourdomain.com Authenticating with existing credentials... [Username: admin] i Info → To login with a different account, run 'docker logout' followed by 'doc ker login' Login Succeeded

push一个试试

先改个带域名tag,再push

[root@localhost harbor]# docker tag goharbor/harbor-core:v2.14.2 yourdomain.com/goharbor/harbor-core:v2.14.2 [root@localhost harbor]# docker push yourdomain.com/goharbor/harbor-core:v2.14.2 The push refers to repository [yourdomain.com/goharbor/harbor-core]

成功!

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/9/2 22:04:51

PowerBI主题模板:35个JSON配置让你的数据报表焕然一新

PowerBI主题模板:35个JSON配置让你的数据报表焕然一新 【免费下载链接】PowerBI-ThemeTemplates Snippets for assembling Power BI Themes 项目地址: https://gitcode.com/gh_mirrors/po/PowerBI-ThemeTemplates 还在为单调的PowerBI报表设计而烦恼吗&#…

作者头像 李华
网站建设 2026/9/2 22:05:16

docker - 容器技术3

对外发布服务端口绑定docker run -itd -p 宿主机端口:容器端口 镜像:标签# 端口绑定[rootdocker ~]# docker run -itd --rm --name web -p 80:80 myos:nginx# 绑定后,直接访问宿主机的 IP 地址即可[rootdocker ~]# curl http://192.168.88.31Nginx is running !# 一…

作者头像 李华
网站建设 2026/9/2 22:01:43

Fillinger脚本终极指南:Illustrator智能填充完整教程

Fillinger脚本终极指南:Illustrator智能填充完整教程 【免费下载链接】illustrator-scripts Adobe Illustrator scripts 项目地址: https://gitcode.com/gh_mirrors/il/illustrator-scripts 还在为复杂的图形填充而烦恼吗?Fillinger脚本正是你需要…

作者头像 李华
网站建设 2026/9/3 3:12:46

实测NewBie-image-Exp0.1:3.5B参数模型动漫创作体验

实测NewBie-image-Exp0.1:3.5B参数模型动漫创作体验 1. 引言 近年来,随着扩散模型在图像生成领域的持续突破,高质量、可控性强的动漫图像生成逐渐成为AI艺术创作的重要方向。然而,部署一个稳定运行的大规模动漫生成模型往往面临…

作者头像 李华
网站建设 2026/9/3 1:28:27

零代码基础也能玩!NewBie-image-Exp0.1动漫生成快速入门

零代码基础也能玩!NewBie-image-Exp0.1动漫生成快速入门 1. 引言 1.1 学习目标 本文旨在为零代码基础的用户提供一份完整、清晰且可操作的 NewBie-image-Exp0.1 动漫图像生成镜像使用指南。通过本教程,你将能够: 快速启动并运行预配置的 …

作者头像 李华
网站建设 2026/8/26 22:59:34

通义千问3-14B工具推荐:LMStudio本地部署免配置教程

通义千问3-14B工具推荐:LMStudio本地部署免配置教程 1. 引言 1.1 业务场景描述 随着大模型在企业级和个人开发者中的广泛应用,如何快速、低成本地将高性能语言模型部署到本地环境成为关键需求。尤其对于资源有限的用户而言,单卡运行、高推…

作者头像 李华