一、环境准备:
CentOS Linux release 7.4.1708 (Core)
docker 18.06.1-ce
docker-compose 1.22.0
ip 10.10.0.135
二、安装方式:
2.1 harbor:
可以选择online或者offline,如果可以正常上网就选择online了,需求包可以在线拉取,offline一般为离线安装,在线也行,需求包都已下载下来,所以比较大一些。
这里我选择online的方式:
https://github.com/goharbor/harbor/releases harbor地址,可选择需求的版本,我这里选择的版本是:v1.6.0 online
2.2 docker-compose:
curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
2.3 解压:
tar -xf harbor-online-installer-v1.6.0.tgz
[root@kubernetes-exam harbor]# grep -v "^#\|^$" harbor.cfg _version = 1.6.0 hostname = 10.10.0.135 ui_url_protocol = http max_job_workers = 10 customize_crt = on ssl_cert = /data/cert/server.crt ssl_cert_key = /data/cert/server.key secretkey_path = /data admiral_url = NA log_rotate_count = 50 log_rotate_size = 200M http_proxy = https_proxy = no_proxy = 127.0.0.1,localhost,ui,registry email_identity = email_server = smtp.mydomain.com email_server_port = 25 email_username = [email protected] email_password = abc email_from = admin <[email protected]> email_ssl = false email_insecure = false harbor_admin_password = Harbor12345 auth_mode = db_auth ldap_url = ldaps://ldap.mydomain.com ldap_basedn = ou=people,dc=mydomain,dc=com ldap_uid = uid ldap_scope = 2 ldap_timeout = 5 ldap_verify_cert = true ldap_group_basedn = ou=group,dc=mydomain,dc=com ldap_group_filter = objectclass=group ldap_group_gid = cn ldap_group_scope = 2 self_registration = on token_expiration = 30 project_creation_restriction = everyone db_host = postgresql db_password = root123 db_port = 5432 db_user = postgres redis_host = redis redis_port = 6379 redis_password = redis_db_index = 1,2,3 clair_db_host = postgresql clair_db_password = root123 clair_db_port = 5432 clair_db_username = postgres clair_db = postgres clair_updaters_interval = 12 uaa_endpoint = uaa.mydomain.org uaa_clientid = id uaa_clientsecret = secret uaa_verify_cert = true uaa_ca_cert = /path/to/ca.pem registry_storage_provider_name = filesystem registry_storage_provider_config = registry_custom_ca_bundle =
(我这里只是修改了hostname为本机ip,别的选择的默认方式。)
bash ./install.sh执行安装程序,安装完后查看:
[root@kubernetes-exam harbor]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE goharbor/redis-photon v1.6.0 745667dc5aa8 8 weeks ago 214MB goharbor/registry-photon v2.6.2-v1.6.0 1ec7d8d4f0fd 8 weeks ago 201MB goharbor/nginx-photon v1.6.0 81df0f8a78c0 8 weeks ago 138MB goharbor/harbor-log v1.6.0 0f474b9d4565 8 weeks ago 203MB goharbor/harbor-jobservice v1.6.0 4e6a3afe6802 8 weeks ago 198MB goharbor/harbor-ui v1.6.0 9cf3894e769e 8 weeks ago 221MB goharbor/harbor-adminserver v1.6.0 14d9ee1bbda3 8 weeks ago 187MB goharbor/harbor-db v1.6.0 5c39f18ce348 8 weeks ago 225MB [root@kubernetes-exam harbor]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 5df2353ac966 goharbor/harbor-jobservice:v1.6.0 "/harbor/start.sh" About an hour ago Up About an hour harbor-jobservice 9b24ef0f204a goharbor/nginx-photon:v1.6.0 "nginx -g 'daemon of…" About an hour ago Up About an hour (healthy) 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:4443->4443/tcp nginx faa6245c2f15 goharbor/harbor-ui:v1.6.0 "/harbor/start.sh" About an hour ago Up About an hour (healthy) harbor-ui cf7e9739f9c5 goharbor/registry-photon:v2.6.2-v1.6.0 "/entrypoint.sh /etc…" About an hour ago Up About an hour (healthy) 5000/tcp registry 1b6f8dd70dc3 goharbor/harbor-adminserver:v1.6.0 "/harbor/start.sh" About an hour ago Up About an hour (healthy) harbor-adminserver f71e44823d36 goharbor/redis-photon:v1.6.0 "docker-entrypoint.s…" About an hour ago Up About an hour 6379/tcp redis c771246886f2 goharbor/harbor-db:v1.6.0 "/entrypoint.sh post…" About an hour ago Up About an hour (healthy) 5432/tcp harbor-db 5750379b3cb1 goharbor/harbor-log:v1.6.0 "/bin/sh -c /usr/loc…" About an hour ago Up About an hour (healthy) 127.0.0.1:1514->10514/tcp harbor-log
web ui登录:
(默认账号和密码:admin/Harbor12345,可在配置文件harbor.cfg中找到,登录后,我将密码修改为了:Fzh411524。)