一、系统环境
组件 | 版本 |
---|---|
Centos | 7.6.1810 |
Jenkins | 2.319.1 |
Docker | 20.10.12 |
Docker-Compose | 1.29.2 |
HARBOR | 2.4.1 |
二、学习资料
三、Docker安装
1、Docker
2、Docker-Compose
四、HARBOR安装
1、下载安装包
下载地址
【注意】
1、HARBOR分1.0和2.0两个大版本,根据自己需要选择版本
2、安装包分离线和在线安装版,我们选择离线安装包
2、官方文档
3、解压安装包
sudo tar -zxvf harbor-offline-installer-v2.4.1.tgz
4、配置文件
进入HARBOR安装目录,对harbor.yml文件进行配置,下面有"配置"注释的行需要修改
# Configuration file of Harbor
# The IP address or hostname to access admin UI and registry service.
# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
# 配置 设定主机名称,可以ip或者域名
hostname: 192.168.x.x
# http related config
http:
# port for http, default is 80. If https enabled, this port will redirect to https port
# 配置 设定http端口号,此处仅启用http方式,如需https方式请查阅相关文档
port: 8182
# https related config
# https:
# https port for harbor, default is 443
# port: 443
# The path of cert and key files for nginx
# certificate: /your/certificate/path
# private_key: /your/private/key/path
# # Uncomment following will enable tls communication between all harbor components
# internal_tls:
# # set enabled to true means internal tls is enabled
# enabled: true
# # put your cert and key files on dir
# dir: /etc/harbor/tls/internal
# Uncomment external_url if you want to enable external proxy
# And when it enabled the hostname will no longer used
# external_url: https://reg.mydomain.com:8433
# The initial password of Harbor admin
# It only works in first time to install harbor
# Remember Change the admin password from UI after launching Harbor.
# 配置 harbor管理员admin的登录密码
harbor_admin_password: Harbor12345
# Harbor DB configuration
database:
# The password for the root user of Harbor DB. Change this before any producti
on use.
# 配置 harbor数据库密码
password: root123
# The maximum number of connections in the idle connection pool. If it <=0, no
idle connections are retained.
max_idle_conns: 100
# The maximum number of open connections to the database. If it <= 0, then the
re is no limit on the number of open connections.
# Note: the default number of connections is 1024 for postgres of harbor.
max_open_conns: 900
# The default data volume
# 配置 HARBOR的DockerVolume位置
data_volume: ~/opt/harbor/data
......
5、安装
# 切换到harbor目录下
# 准备阶段
./prepare
# 安装阶段
./install.sh
【注意】HARBOR为Docker一键安装,安装成功后会启动相关镜像
6、登录
访问HARBOR地址,如:192.168.x.x:8182,端口号为HARBOR配置文件中指定