這個(gè)harbor離線安裝是么蛾子最少的绊汹。
簡(jiǎn)介
Harbor是一個(gè)用于存儲(chǔ)和分發(fā)Docker鏡像的企業(yè)級(jí)Registry服務(wù)器腿倚,通過添加一些企業(yè)必需的功能特性昏滴,例如安全、標(biāo)識(shí)和管理等累颂,擴(kuò)展了開源Docker Distribution滞详。作為一個(gè)企業(yè)級(jí)私有Registry服務(wù)器,Harbor提供了更好的性能和安全喘落。提升用戶使用Registry構(gòu)建和運(yùn)行環(huán)境傳輸鏡像的效率茵宪。Harbor支持安裝在多個(gè)Registry節(jié)點(diǎn)的鏡像資源復(fù)制,鏡像全部保存在私有Registry中瘦棋, 確保數(shù)據(jù)和知識(shí)產(chǎn)權(quán)在公司內(nèi)部網(wǎng)絡(luò)中管控稀火。另外,Harbor也提供了高級(jí)的安全特性赌朋,諸如用戶管理凰狞,訪問控制和活動(dòng)審計(jì)等。
安裝步驟
一沛慢,下載harbor-offline-installer-v1.10.2.tgz赡若,并解壓。
這個(gè)包团甲,還是蠻大的逾冬,從github上下載,要耐心躺苦。
建立找百度網(wǎng)盤身腻,找好心人提供的下載鏈接。
二匹厘,安裝docker及docker-compose嘀趟,按下不表。
三愈诚,進(jìn)入harbor目錄她按,修改harbor.yml文件
修改Hostname,http.port,注釋掉https牛隅,更改harbor_admin_password
# 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.
hostname: 192.168.1.111
# http related config
http:
# port for http, default is 80. If https enabled, this port will redirect to https port
port: 8089
# 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 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_password: xxxxxxx
四,在harbor目錄酌泰,執(zhí)行./install.sh媒佣。
輸出如下(其中有個(gè)小波折,是沒有設(shè)置Hostname):
[root@localhost harbor]# ./install.sh
[Step 0]: checking if docker is installed ...
Note: docker version: 19.03.8
[Step 1]: checking docker-compose is installed ...
Note: docker-compose version: 1.18.0
[Step 2]: loading Harbor images ...
ad1dca7cdecb: Loading layer [==================================================>] 34.5MB/34.5MB
fe0efe3b32dc: Loading layer [==================================================>] 63.56MB/63.56MB
5504ea8a1c89: Loading layer [==================================================>] 58.39MB/58.39MB
e5fe51919fa7: Loading layer [==================================================>] 5.632kB/5.632kB
5591c247d2e6: Loading layer [==================================================>] 2.048kB/2.048kB
db6a70d4a66e: Loading layer [==================================================>] 2.56kB/2.56kB
a898589079d4: Loading layer [==================================================>] 2.56kB/2.56kB
a45af9651ff3: Loading layer [==================================================>] 2.56kB/2.56kB
be9c1b049bcc: Loading layer [==================================================>] 10.24kB/10.24kB
Loaded image: goharbor/harbor-db:v1.10.2
346fb2bd57a4: Loading layer [==================================================>] 8.435MB/8.435MB
2e3e5d2fc1dd: Loading layer [==================================================>] 6.239MB/6.239MB
ef4f6d3760d4: Loading layer [==================================================>] 16.04MB/16.04MB
c72e6e471644: Loading layer [==================================================>] 28.25MB/28.25MB
8ef2ab5918ad: Loading layer [==================================================>] 22.02kB/22.02kB
8c6f27a03a6c: Loading layer [==================================================>] 50.52MB/50.52MB
Loaded image: goharbor/notary-server-photon:v1.10.2
6d0fd267be6a: Loading layer [==================================================>] 115.2MB/115.2MB
cc6a0cb3722a: Loading layer [==================================================>] 12.14MB/12.14MB
2df571d6ea95: Loading layer [==================================================>] 3.072kB/3.072kB
9971e5655191: Loading layer [==================================================>] 49.15kB/49.15kB
10c405f9f0e2: Loading layer [==================================================>] 3.584kB/3.584kB
6861c00be6c7: Loading layer [==================================================>] 13.02MB/13.02MB
Loaded image: goharbor/clair-photon:v1.10.2
1826656409e9: Loading layer [==================================================>] 10.28MB/10.28MB
8cdf4e864764: Loading layer [==================================================>] 7.697MB/7.697MB
15824ca72188: Loading layer [==================================================>] 223.2kB/223.2kB
16130654d1d1: Loading layer [==================================================>] 195.1kB/195.1kB
f3ed25db3f03: Loading layer [==================================================>] 15.36kB/15.36kB
3580b56fee01: Loading layer [==================================================>] 3.584kB/3.584kB
Loaded image: goharbor/harbor-portal:v1.10.2
a6d6e26561c2: Loading layer [==================================================>] 12.21MB/12.21MB
86ec36cec073: Loading layer [==================================================>] 42.5MB/42.5MB
a834e5c5df07: Loading layer [==================================================>] 5.632kB/5.632kB
d74d9eba8546: Loading layer [==================================================>] 40.45kB/40.45kB
6d5eed6f3419: Loading layer [==================================================>] 42.5MB/42.5MB
484994b6bc3f: Loading layer [==================================================>] 2.56kB/2.56kB
Loaded image: goharbor/harbor-core:v1.10.2
8b67d91d471e: Loading layer [==================================================>] 12.21MB/12.21MB
2584449c95d0: Loading layer [==================================================>] 49.37MB/49.37MB
Loaded image: goharbor/harbor-jobservice:v1.10.2
b23fa00ea843: Loading layer [==================================================>] 8.441MB/8.441MB
b2c0f9d70915: Loading layer [==================================================>] 3.584kB/3.584kB
b503c86a04d4: Loading layer [==================================================>] 21.76MB/21.76MB
b360fa5431c1: Loading layer [==================================================>] 3.072kB/3.072kB
eb575ebe03ac: Loading layer [==================================================>] 8.662MB/8.662MB
80fb2b0f0315: Loading layer [==================================================>] 31.24MB/31.24MB
Loaded image: goharbor/harbor-registryctl:v1.10.2
1358663a68ec: Loading layer [==================================================>] 82.23MB/82.23MB
711a7d4ecee3: Loading layer [==================================================>] 3.072kB/3.072kB
5bb647da1c5e: Loading layer [==================================================>] 59.9kB/59.9kB
57ea330779ba: Loading layer [==================================================>] 61.95kB/61.95kB
Loaded image: goharbor/redis-photon:v1.10.2
dd582a00d0e4: Loading layer [==================================================>] 10.28MB/10.28MB
Loaded image: goharbor/nginx-photon:v1.10.2
f4ce9d4c5979: Loading layer [==================================================>] 8.44MB/8.44MB
4df17639d73c: Loading layer [==================================================>] 42.3MB/42.3MB
06a92309fcf7: Loading layer [==================================================>] 3.072kB/3.072kB
6961179c06b3: Loading layer [==================================================>] 3.584kB/3.584kB
24058aa4795e: Loading layer [==================================================>] 43.12MB/43.12MB
Loaded image: goharbor/chartmuseum-photon:v1.10.2
28bdd74b7611: Loading layer [==================================================>] 49.82MB/49.82MB
312844c67ef0: Loading layer [==================================================>] 3.584kB/3.584kB
97ff7939d09c: Loading layer [==================================================>] 3.072kB/3.072kB
fe1ca6ca62b1: Loading layer [==================================================>] 2.56kB/2.56kB
807185e8884e: Loading layer [==================================================>] 3.072kB/3.072kB
7014ac08f821: Loading layer [==================================================>] 3.584kB/3.584kB
b9a09e8231aa: Loading layer [==================================================>] 12.29kB/12.29kB
Loaded image: goharbor/harbor-log:v1.10.2
5fc142634b19: Loading layer [==================================================>] 8.441MB/8.441MB
6d25b55ca036: Loading layer [==================================================>] 3.584kB/3.584kB
470e0bc7c886: Loading layer [==================================================>] 3.072kB/3.072kB
6deec48d670d: Loading layer [==================================================>] 21.76MB/21.76MB
4b0f50c1f9a2: Loading layer [==================================================>] 22.59MB/22.59MB
Loaded image: goharbor/registry-photon:v1.10.2
7c0c9681bb5c: Loading layer [==================================================>] 14.61MB/14.61MB
f8f5185485f0: Loading layer [==================================================>] 28.25MB/28.25MB
7aa4e440ddd4: Loading layer [==================================================>] 22.02kB/22.02kB
1bf5d3e32ab4: Loading layer [==================================================>] 49.09MB/49.09MB
Loaded image: goharbor/notary-signer-photon:v1.10.2
e5f331e45d1c: Loading layer [==================================================>] 337.3MB/337.3MB
e0d97714dc5d: Loading layer [==================================================>] 135.2kB/135.2kB
Loaded image: goharbor/harbor-migrator:v1.10.2
6b5627387d23: Loading layer [==================================================>] 77.91MB/77.91MB
6d898f9318cc: Loading layer [==================================================>] 48.28MB/48.28MB
3e9ed699ea3e: Loading layer [==================================================>] 2.56kB/2.56kB
3bc549d11dcc: Loading layer [==================================================>] 1.536kB/1.536kB
74fd1d3f8fa2: Loading layer [==================================================>] 157.2kB/157.2kB
547fd9c0c9c5: Loading layer [==================================================>] 2.81MB/2.81MB
Loaded image: goharbor/prepare:v1.10.2
9d7087c5277a: Loading layer [==================================================>] 8.441MB/8.441MB
c0f8862cab3f: Loading layer [==================================================>] 9.71MB/9.71MB
a9e3fbb9bcfc: Loading layer [==================================================>] 9.71MB/9.71MB
Loaded image: goharbor/clair-adapter-photon:v1.10.2
[Step 3]: preparing environment ...
[Step 4]: preparing harbor configs ...
prepare base dir is set to /root/harbor
ERROR:root:Please specify hostname
[root@localhost harbor]# vim harbor.yml
[root@localhost harbor]# ./install.sh
[Step 0]: checking if docker is installed ...
Note: docker version: 19.03.8
[Step 1]: checking docker-compose is installed ...
Note: docker-compose version: 1.18.0
[Step 2]: loading Harbor images ...
Loaded image: goharbor/harbor-db:v1.10.2
Loaded image: goharbor/notary-server-photon:v1.10.2
Loaded image: goharbor/clair-photon:v1.10.2
Loaded image: goharbor/harbor-portal:v1.10.2
Loaded image: goharbor/harbor-core:v1.10.2
Loaded image: goharbor/harbor-jobservice:v1.10.2
Loaded image: goharbor/harbor-registryctl:v1.10.2
Loaded image: goharbor/redis-photon:v1.10.2
Loaded image: goharbor/nginx-photon:v1.10.2
Loaded image: goharbor/chartmuseum-photon:v1.10.2
Loaded image: goharbor/harbor-log:v1.10.2
Loaded image: goharbor/registry-photon:v1.10.2
Loaded image: goharbor/notary-signer-photon:v1.10.2
Loaded image: goharbor/harbor-migrator:v1.10.2
Loaded image: goharbor/prepare:v1.10.2
Loaded image: goharbor/clair-adapter-photon:v1.10.2
[Step 3]: preparing environment ...
[Step 4]: preparing harbor configs ...
prepare base dir is set to /root/harbor
WARNING:root:WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https
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/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
Generated and saved secret to file: /secret/keys/secretkey
Creating harbor-log ... done
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir
Creating harbor-db ... done
Creating harbor-core ... done
Creating network "harbor_harbor" with the default driver
Creating nginx ... done
Creating registry ...
Creating registryctl ...
Creating redis ...
Creating harbor-db ...
Creating harbor-portal ...
Creating harbor-core ...
Creating nginx ...
Creating harbor-jobservice ...
? ----Harbor has been installed and started successfully.----
五宫莱,瀏覽器訪問丈攒,搞定!
六 錯(cuò)誤
如果install.sh啟動(dòng)異常:
[Step 5]: starting Harbor ...
Creating network "harbor_harbor" with the default driver
Creating harbor-log ... done
Creating registryctl ...
Creating registry ... error
Creating registryctl ... error
Creating redis ...
Creating harbor-db ...
ERROR: for registry Cannot start service registry: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused
Creating redis ... error
Creating harbor-portal ... error
ERROR: for redis Cannot start service redis: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused
Creating harbor-db ... done
ERROR: for registry Cannot start service registry: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused
ERROR: for registryctl Cannot start service registryctl: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused
ERROR: for redis Cannot start service redis: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused
ERROR: for portal Cannot start service portal: failed to initialize logging driver: dial tcp 127.0.0.1:1514: connect: connection refused
ERROR: Encountered errors while bringing up the project.
harbor-log的鏡像不能啟動(dòng)授霸,報(bào)如下錯(cuò)誤:
Changing password for root.
sudo: Account or password is expired, reset your password and try again
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: unable to change expired password: Authentication token manipulation error
解決:
使用1.10.3或以上版本的harbor,
1.10.2版本就是不能用<什濉5舛!?虺凇辛辨!