harbor安装

镜像下载、域名解析、时间同步请点击
阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区
 
系统版本:centos linux release 7.6.1810 (Core)
Docker版本:20.10.12
docker-compose版本:v2.3.2
一、安装docker-compose:把在百度网盘下载的docker-compose文件到服务器里
[root@zabbix 14:57:42~]# chmod +x docker-compose-linux-x86_64 [root@zabbix 14:57:48~]# mv docker-compose-linux-x86_64 /usr/local/sbin/docker-compose二、安装harbor1、上传在百度网盘下载的harbor压缩包文件到服务器里:
[root@zabbix 14:58:29/data/recycle]# lltotal 1237904-rw-r--r-- 1 root root 612698835 Mar9 14:59 harbor-offline-installer-v2.4.1.tgz[root@zabbix 14:59:20/data/recycle]#2、解压harbor:
[root@zabbix 14:59:20/data/recycle]# tar zxf harbor-offline-installer-v2.4.1.tgz [root@zabbix 14:59:30/data/recycle]# lltotal 1237908drwxr-xr-x 2 root root4096 Mar9 14:59 harbor-rw-r--r-- 1 root root 612698835 Mar9 14:59 harbor-offline-installer-v2.4.1.tgz3、移动到部署目录:
[root@zabbix 14:59:47/data/recycle]# mv harbor /data/software/[root@zabbix 14:59:54/data/recycle]# cd /data/software/harbor/[root@zabbix 15:00:00/data/software/harbor]# lltotal 601612-rw-r--r-- 1 root root3361 Dec 16 12:22 common.sh-rw-r--r-- 1 root root 616006217 Dec 16 12:23 harbor.v2.4.1.tar.gz-rw-r--r-- 1 root root8999 Dec 16 12:22 harbor.yml.tmpl-rwxr-xr-x 1 root root2500 Dec 16 12:22 install.sh-rw-r--r-- 1 root root11347 Dec 16 12:22 LICENSE-rwxr-xr-x 1 root root1881 Dec 16 12:22 prepare4、修改配置文件
[root@zabbix 15:00:06/data/software/harbor]# cp harbor.yml.tmpl harbor.ymlvim harbor.yml

harbor安装

文章插图
 
5、修改daemon,并添加http的通信地址,不然docker默认使用https进行通信,如果配置了https协议就不需要添加
## 如果不修改,可能会碰到如下错误,只是不一定## [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". [root@zabbix 16:08:52/data/software/harbor]# cat /etc/docker/daemon.json {"registry-mirrors": ["https://nr240upq.mirror.aliyuncs.com", "https://registry.docker-cn.com", "https://docker.mirrors.ustc.edu.cn", "https://dockerhub.azk8s.cn", "http://hub-mirror.c.163.com"],"exec-opts": ["native.cgroupdriver=systemd"],"log-driver": "json-file","log-opts": {"max-size": "100m"},"insecure-registries": ["172.17.0.100:5000"]}[root@zabbix 16:16:59/data/software/harbor]#
harbor安装

文章插图
 
改好之后,重新加载配置和重启docker
[root@zabbix 15:00:50/data/software/harbor]# systemctl daemon-reload && systemctl restart docker6、执行部署脚本:./install.sh
[root@zabbix 15:03:56/data/software/harbor]# ./install.sh[Step 0]: checking if docker is installed ... Note: docker version: 20.10.12 [Step 1]: checking docker-compose is installed ... Note: docker-compose version: 2.3.2 [Step 2]: loading Harbor images ...1e3f0dc884e2: Loading layer [==================================================>]39.45MB/39.45MB3fd9ccd5eeaa: Loading layer [==================================================>]5.275MB/5.275MBc600bceee2f7: Loading layer [==================================================>]4.096kB/4.096kB724cd8711815: Loading layer [==================================================>]3.072kB/3.072kBd7c82a981c89: Loading layer [==================================================>]17.32MB/17.32MBa814341c2c44: Loading layer [==================================================>]18.12MB/18.12MBLoaded image: goharbor/registry-photon:v2.4.1b00595b6932d: Loading layer [==================================================>]5.27MB/5.27MBe34892d856ce: Loading layer [==================================================>]5.928MB/5.928MBac5a22c6047d: Loading layer [==================================================>]14.47MB/14.47MB3d1ac12eb215: Loading layer [==================================================>]29.29MB/29.29MB394b4b2ea0fa: Loading layer [==================================================>]22.02kB/22.02kBbb0deb7416e0: Loading layer [==================================================>]14.47MB/14.47MBLoaded image: goharbor/notary-signer-photon:v2.4.1c3b02aec560c: Loading layer [==================================================>]8.422MB/8.422MB4d5b3acd128e: Loading layer [==================================================>]3.584kB/3.584kB7afbf44c3706: Loading layer [==================================================>]2.56kB/2.56kB31f95ac6eb9a: Loading layer [==================================================>]75.59MB/75.59MB8981a12f5c17: Loading layer [==================================================>]5.632kB/5.632kB16eb0821dcc3: Loading layer [==================================================>]96.26kB/96.26kBb19eba29a0de: Loading layer [==================================================>]11.78kB/11.78kBf0785d2e9965: Loading layer [==================================================>]76.49MB/76.49MB26ce29b9d7ab: Loading layer [==================================================>]2.56kB/2.56kBLoaded image: goharbor/harbor-core:v2.4.159e3814aa5f1: Loading layer [==================================================>]119.8MB/119.8MB1e99e9cd580e: Loading layer [==================================================>]3.072kB/3.072kB2bab205001c7: Loading layer [==================================================>]59.9kB/59.9kBc51450af480c: Loading layer [==================================================>]61.95kB/61.95kBLoaded image: goharbor/redis-photon:v2.4.13636ff090145: Loading layer [==================================================>]8.421MB/8.421MBfa3d57c372c8: Loading layer [==================================================>]3.584kB/3.584kBa2c97825dcbf: Loading layer [==================================================>]2.56kB/2.56kB366b1363b528: Loading layer [==================================================>]86.95MB/86.95MB3d2fd6d13a0f: Loading layer [==================================================>]87.74MB/87.74MBLoaded image: goharbor/harbor-jobservice:v2.4.18f71cf8bc1c6: Loading layer [==================================================>]5.275MB/5.275MB5cb3457d8e25: Loading layer [==================================================>]4.096kB/4.096kB02c18fad9dc6: Loading layer [==================================================>]17.32MB/17.32MB7bbcea1ec44e: Loading layer [==================================================>]3.072kB/3.072kBf2842e1ada70: Loading layer [==================================================>]28.69MB/28.69MB4665575c3f9e: Loading layer [==================================================>]46.81MB/46.81MBLoaded image: goharbor/harbor-registryctl:v2.4.1439595cfbbc0: Loading layer [==================================================>]7.192MB/7.192MBLoaded image: goharbor/Nginx-photon:v2.4.1a19de03ace6b: Loading layer [==================================================>]5.27MB/5.27MB35bbd4cf35b6: Loading layer [==================================================>]5.928MB/5.928MB88f852ebd746: Loading layer [==================================================>]15.88MB/15.88MBe3c0db81a28c: Loading layer [==================================================>]29.29MB/29.29MBf74e521b7a55: Loading layer [==================================================>]22.02kB/22.02kB7d97a705f439: Loading layer [==================================================>]15.88MB/15.88MBLoaded image: goharbor/notary-server-photon:v2.4.11e6473070b18: Loading layer [==================================================>]124MB/124MBf05c1a477d2d: Loading layer [==================================================>]3.584kB/3.584kBbcab3e00aa98: Loading layer [==================================================>]3.072kB/3.072kB970d569f474a: Loading layer [==================================================>]2.56kB/2.56kBc659c9812277: Loading layer [==================================================>]3.072kB/3.072kB9d401ff8bf07: Loading layer [==================================================>]3.584kB/3.584kB968dfed00d2e: Loading layer [==================================================>]19.97kB/19.97kBLoaded image: goharbor/harbor-log:v2.4.1b64000a1cd2c: Loading layer [==================================================>]1.097MB/1.097MBe3fb7ac15701: Loading layer [==================================================>]5.889MB/5.889MBd6e7f8008582: Loading layer [==================================================>]165.9MB/165.9MBeff0812a8c6f: Loading layer [==================================================>]15.07MB/15.07MB91a6abd7a540: Loading layer [==================================================>]4.096kB/4.096kB47e875926154: Loading layer [==================================================>]6.144kB/6.144kB04876e025d4a: Loading layer [==================================================>]3.072kB/3.072kBb817a88114e6: Loading layer [==================================================>]2.048kB/2.048kBe5fb37021dff: Loading layer [==================================================>]2.56kB/2.56kB767486d5c318: Loading layer [==================================================>]2.56kB/2.56kBb92f2b842b46: Loading layer [==================================================>]2.56kB/2.56kBe90e3a7ea4e9: Loading layer [==================================================>]8.704kB/8.704kBLoaded image: goharbor/harbor-db:v2.4.1daf3d38cddc8: Loading layer [==================================================>]8.422MB/8.422MB8013b2cbc0b9: Loading layer [==================================================>]18.13MB/18.13MB4445f5ea7083: Loading layer [==================================================>]4.608kB/4.608kB32e035f0af8e: Loading layer [==================================================>]18.93MB/18.93MBLoaded image: goharbor/harbor-exporter:v2.4.10ad72e88d766: Loading layer [==================================================>]8.54MB/8.54MBfe195f48d47b: Loading layer [==================================================>]4.096kB/4.096kB71f2671db231: Loading layer [==================================================>]3.072kB/3.072kBddda0b4a8eae: Loading layer [==================================================>]39.27MB/39.27MBc3fe76027866: Loading layer [==================================================>]12.37MB/12.37MBd82a7403c39a: Loading layer [==================================================>]52.43MB/52.43MBLoaded image: goharbor/trivy-adapter-photon:v2.4.103e449493f09: Loading layer [==================================================>]5.275MB/5.275MB4f4a25c7cc0d: Loading layer [==================================================>]64.5MB/64.5MB77a37df05436: Loading layer [==================================================>]3.072kB/3.072kB47c58e48962d: Loading layer [==================================================>]4.096kB/4.096kB5dd56c28f3fc: Loading layer [==================================================>]65.29MB/65.29MBLoaded image: goharbor/chartmuseum-photon:v2.4.18b7cbddd8918: Loading layer [==================================================>]165.6MB/165.6MBb8157b6f7cb8: Loading layer [==================================================>]57.6MB/57.6MB4a53b9a92b30: Loading layer [==================================================>]2.56kB/2.56kB59184fc56c3c: Loading layer [==================================================>]1.536kB/1.536kB99431fe2c10f: Loading layer [==================================================>]12.29kB/12.29kB3735b7f4881f: Loading layer [==================================================>]2.62MB/2.62MBbcff3633b236: Loading layer [==================================================>]325.6kB/325.6kBLoaded image: goharbor/prepare:v2.4.1eb57d0945b2e: Loading layer [==================================================>]7.192MB/7.192MBdd9069fd53a8: Loading layer [==================================================>]7.355MB/7.355MBe779dab1d180: Loading layer [==================================================>]1.754MB/1.754MBLoaded image: goharbor/harbor-portal:v2.4.1[Step 3]: preparing environment ... [Step 4]: preparing harbor configs ...prepare base dir is set to /data/software/harborWARNING:root:WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to httpsGenerated configuration file: /config/portal/nginx.confGenerated configuration file: /config/log/logrotate.confGenerated configuration file: /config/log/rsyslog_docker.confGenerated configuration file: /config/nginx/nginx.confGenerated configuration file: /config/core/envGenerated configuration file: /config/core/App.confGenerated configuration file: /config/registry/config.ymlGenerated configuration file: /config/registryctl/envGenerated configuration file: /config/registryctl/config.ymlGenerated configuration file: /config/db/envGenerated configuration file: /config/jobservice/envGenerated configuration file: /config/jobservice/config.ymlGenerated and saved secret to file: /data/secret/keys/secretkeySuccessfully called func: create_root_certGenerated configuration file: /compose_location/docker-compose.ymlClean up the input dir[Step 5]: starting Harbor ...[+] Running 10/10 ?.NETwork harbor_harborCreated0.0s ? Container harbor-logStarted0.6s ? Container redisStarted1.3s ? Container registryctlStarted1.4s ? Container registryStarted1.4s ? Container harbor-dbStarted1.4s ? Container harbor-portalStarted1.3s ? Container harbor-coreStarted1.7s ? Container harbor-jobserviceStarted2.3s ? Container nginxStarted2.4s? ----Harbor has been installed and started successfully.----[root@zabbix 15:04:47/data/software/harbor]#


推荐阅读