3.解压
tar xf harbor-offline-installer-v1.2.0-rc3.tgz
4.修改harbor.cfg文件
cd harbor
把hostname改成这样 hostanme=ip(或解析的域名)
hostname = 172.16.1.200
其他可以不改
5.habor.cfg参数详解
[root@linux-node2 ~]# grep ^[a-Z] /usr/local/src/harbor/harbor.cfg
hostname = 192.168.56.12 #主机IP/主机名
ui_url_protocol = http #访问协议,支持http和https
email_identity =
email_server = smtp.163.com
email_server_port = 25
email_username = scjianlin@163.com
email_password = xxxx
email_from = admin <scjianlin@163.com>
email_ssl = false
harbor_admin_password = Harbor12345
auth_mode = db_auth #认证方式,默认是 db_auth ,既mysql数据库存储认证,这里还支持 ldap 以及 本地文件存储方式。
ldap_url = ldaps://ldap.mydomain.com
ldap_basedn = ou=people,dc=mydomain,dc=com
ldap_uid = uid
ldap_scope = 3
db_password = root123
self_registration = on
use_compressed_js = on
max_job_workers = 3
token_expiration = 30
verify_remote_cert = on
customize_crt = on
crt_country = CN
crt_state = State
crt_location = CN
crt_organization = organization
crt_organizationalunit = organizational unit
crt_commonname = example.com
crt_email = example@example.com
project_creation_restriction = everyone
[root@linux-node2 ~]#
[root@linux-node2 harbor]# ./prepare #运行脚本跟新配置
loaded secret key
Clearing the configuration file: ./common/config/ui/env
Clearing the configuration file: ./common/config/ui/app.conf
Clearing the configuration file: ./common/config/ui/private_key.pem
Clearing the configuration file: ./common/config/db/env
Clearing the configuration file: ./common/config/jobservice/env
Clearing the configuration file: ./common/config/jobservice/app.conf
Clearing the configuration file: ./common/config/registry/config.yml
Clearing the configuration file: ./common/config/registry/root.crt
Clearing the configuration file: ./common/config/nginx/nginx.conf
Generated configuration file: ./common/config/nginx/nginx.conf
Generated configuration file: ./common/config/ui/env
Generated configuration file: ./common/config/ui/app.conf
Generated configuration file: ./common/config/registry/config.yml
Generated configuration file: ./common/config/db/env
Generated configuration file: ./common/config/jobservice/env
Generated configuration file: ./common/config/jobservice/app.conf
Generated configuration file: ./common/config/ui/private_key.pem
Generated configuration file: ./common/config/registry/root.crt
The configuration files are ready, please use docker-compose to start the service.
#执行完毕后会在当前目录生成一个docker-compose.yml文件,用于配置数据目录等配置信息:
#官方安装并启动harbor:
6.执行./install.sh 然后慢慢等待
./install.sh