五分鐘離線安裝Harbor

這個(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.----

五宫莱,瀏覽器訪問丈攒,搞定!

2020-04-26 20_31_34-Harbor.png

六 錯(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舛!?虺凇辛辨!

參考URL:
https://summeram.com/2020/06/23/docker%e5%92%8charbor%e5%90%af%e5%8a%a8%e5%a4%b1%e8%b4%a5%e8%a7%a3%e5%86%b3/

https://kb.vmware.com/s/article/79497

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市瑟枫,隨后出現(xiàn)的幾起案子斗搞,更是在濱河造成了極大的恐慌,老刑警劉巖慷妙,帶你破解...
    沈念sama閱讀 217,509評(píng)論 6 504
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件僻焚,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡膝擂,警方通過查閱死者的電腦和手機(jī)虑啤,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,806評(píng)論 3 394
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來架馋,“玉大人狞山,你說我怎么就攤上這事〔婕牛” “怎么了萍启?”我有些...
    開封第一講書人閱讀 163,875評(píng)論 0 354
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)屏鳍。 經(jīng)常有香客問我勘纯,道長(zhǎng),這世上最難降的妖魔是什么孕蝉? 我笑而不...
    開封第一講書人閱讀 58,441評(píng)論 1 293
  • 正文 為了忘掉前任屡律,我火速辦了婚禮,結(jié)果婚禮上降淮,老公的妹妹穿的比我還像新娘超埋。我一直安慰自己搏讶,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,488評(píng)論 6 392
  • 文/花漫 我一把揭開白布霍殴。 她就那樣靜靜地躺著媒惕,像睡著了一般。 火紅的嫁衣襯著肌膚如雪来庭。 梳的紋絲不亂的頭發(fā)上妒蔚,一...
    開封第一講書人閱讀 51,365評(píng)論 1 302
  • 那天,我揣著相機(jī)與錄音月弛,去河邊找鬼肴盏。 笑死,一個(gè)胖子當(dāng)著我的面吹牛帽衙,可吹牛的內(nèi)容都是我干的菜皂。 我是一名探鬼主播,決...
    沈念sama閱讀 40,190評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼厉萝,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼恍飘!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起谴垫,我...
    開封第一講書人閱讀 39,062評(píng)論 0 276
  • 序言:老撾萬榮一對(duì)情侶失蹤章母,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后翩剪,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體乳怎,經(jīng)...
    沈念sama閱讀 45,500評(píng)論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,706評(píng)論 3 335
  • 正文 我和宋清朗相戀三年肢专,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了舞肆。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 39,834評(píng)論 1 347
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡博杖,死狀恐怖椿胯,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情剃根,我是刑警寧澤哩盲,帶...
    沈念sama閱讀 35,559評(píng)論 5 345
  • 正文 年R本政府宣布,位于F島的核電站狈醉,受9級(jí)特大地震影響廉油,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜苗傅,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,167評(píng)論 3 328
  • 文/蒙蒙 一抒线、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧渣慕,春花似錦嘶炭、人聲如沸抱慌。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,779評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽抑进。三九已至,卻和暖如春睡陪,著一層夾襖步出監(jiān)牢的瞬間寺渗,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,912評(píng)論 1 269
  • 我被黑心中介騙來泰國(guó)打工兰迫, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留信殊,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 47,958評(píng)論 2 370
  • 正文 我出身青樓汁果,卻偏偏與公主長(zhǎng)得像鸡号,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子须鼎,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,779評(píng)論 2 354

推薦閱讀更多精彩內(nèi)容