VMWare Harbor搭建手冊(cè)

1.??? 環(huán)境準(zhǔn)備

搭建使用虛擬機(jī),所裝操作系統(tǒng)是Centos7,以下是安裝的軟件和版本需求

Docker: Version >= 1.10.0

Docker-compse: Version >= 1.6.0

Harbor: Version 1.2.2

2.搭建過程

(1)Docker安裝

yum安裝 yum install docker

(2)Docker-compose安裝

a) 拷貝docker-compose-Linux-x86_64到/usr/local/bin目錄下

b) 對(duì)二進(jìn)制文件賦可執(zhí)行權(quán)限

chmod +x /usr/local/bin/docker-compose

c) 測(cè)試下是否安裝成功

docker-compose –version

(3)Harbor搭建

a)下載Harbor離線安裝包(具體文件參照上層目錄 harbor-offline-installer-v1.2.2.tgz),將文件拷貝至虛擬機(jī),并解壓

tar xvf harbor-offline-installer-v1.2.2.tgz

b) 配置Harbor

解壓之后,目錄下會(huì)生成harbor文件夾,進(jìn)入文件夾中修改harbor.cfg文件,將hostname修改為虛擬機(jī)ip地址

c)執(zhí)行prepare腳本,創(chuàng)建docker-compose中需要的配置文件

./prepare

d)檢查docker-compose.yml文件,檢查所有容器中volumes對(duì)應(yīng)的本地目錄是否存在,如果不存在則手動(dòng)創(chuàng)建

e) 執(zhí)行安裝腳本

./install.sh


[root@localhost harbor]# ./install.sh

[Step 0]: checking installation environment ...

Note: docker version: 1.10.3

Note: docker-compose version: 1.17.1

[Step 1]: loading Harbor images ...

[Step 2]: preparing environment ...

Clearing the configuration file: ./common/config/adminserver/env

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

loaded secret from file: /data/secretkey

Generated configuration file: ./common/config/nginx/nginx.conf

Generated configuration file: ./common/config/adminserver/env

Generated configuration file: ./common/config/ui/env

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/app.conf

Generated certificate, key file: ./common/config/ui/private_key.pem, cert file: ./common/config/registry/root.crt

The configuration files are ready, please use docker-compose to start the service.

[Step 3]: checking existing instance of Harbor ...

Note: stopping existing Harbor instance ...

[Step 4]: starting Harbor ...

Creating network "harbor_harbor" with the default driver

Creating harbor-log ...

Creating harbor-log ... done

Creating harbor-adminserver ...

Creating registry ...

Creating harbor-adminserver

Creating harbor-db ...

Creating registry

Creating registry ... done

Creating harbor-ui ...

Creating harbor-ui ... done

Creating harbor-jobservice ...

Creating nginx ...

Creating harbor-jobservice

Creating nginx ... done

? ----Harbor has been installed and started successfully.----

Now you should be able to visit the admin portal athttp://100.2.104.51.

For more details, please visithttps://github.com/vmware/harbor.


f)查看是否所有容器都已經(jīng)創(chuàng)建成功并處于UP狀態(tài)

docker ps


如果有容器不是狀態(tài)不是UP,則沒有搭建成功,需要從步驟e)重新開始

g)訪問Harbor

訪問http://100.2.104.51,頁面如下


最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容