harbor v2.10.0 安装过程
·
harbor 是什么?
harbor 是一款开源软件,主要用于解决私有化部署的docker 镜像管理的仓库问题.
一、前置条件
下载软件包:harbor-offline-installer-v2.10.0.tgz。
docker 及docker compose 环境准备好
二、安装过程及坑点
- 解压harbor-offline-installer-v2.10.0.tgz
- COPY出配置文件, 将“harbor.yml.tmpl” COPY 出一份为”harbor.yml“
- 修改配置文件
- 运行项目。
三、安装过程的命令行示例
$ ll
总计 626724
drwxrwxr-x 2 liu liu 4096 11月 10 07:59 ./
drwxrwxr-x 18 liu liu 4096 11月 10 07:59 ../
-rwxr-xr-x 1 liu liu 641749145 10月 8 2024 harbor-offline-installer-v2.10.0.tgz*
$ tar -zxvf harbor-offline-installer-v2.10.0.tgz
harbor/harbor.v2.10.0.tar.gz
harbor/prepare
harbor/LICENSE
harbor/install.sh
harbor/common.sh
harbor/harbor.yml.tmpl
$ cd harbor/
/harbor$ ll
总计 631188
drwxrwxr-x 2 liu liu 4096 11月 10 08:02 ./
drwxrwxr-x 3 liu liu 4096 11月 10 08:02 ../
-rw-r--r-- 1 liu liu 3643 12月 14 2023 common.sh
-rw-r--r-- 1 liu liu 646285764 12月 14 2023 harbor.v2.10.0.tar.gz
-rw-r--r-- 1 liu liu 13761 12月 14 2023 harbor.yml.tmpl
-rwxr-xr-x 1 liu liu 1975 12月 14 2023 install.sh*
-rw-r--r-- 1 liu liu 11347 12月 14 2023 LICENSE
-rwxr-xr-x 1 liu liu 1882 12月 14 2023 prepare*
/harbor$ cp harbor.yml.tmpl harbor.yml
/harbor$ vim harbor.yml
/harbor$ bash install.sh
[Step 0]: checking if docker is installed ...
Note: docker version: 28.5.1
[Step 1]: checking docker-compose is installed ...
Note: Docker Compose version v2.40.3
[Step 2]: loading Harbor images ...
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.51/images/load?quiet=0": dial unix /var/run/docker.sock: connect: permission denied
/harbor$ sudo bash install.sh
[sudo] liu 的密码:
[Step 0]: checking if docker is installed ...
Note: docker version: 28.5.1
[Step 1]: checking docker-compose is installed ...
Note: Docker Compose version v2.40.3
[Step 2]: loading Harbor images ...
Loaded image: goharbor/trivy-adapter-photon:v2.10.0
Loaded image: goharbor/prepare:v2.10.0
Loaded image: goharbor/harbor-log:v2.10.0
Loaded image: goharbor/harbor-registryctl:v2.10.0
Loaded image: goharbor/nginx-photon:v2.10.0
Loaded image: goharbor/harbor-exporter:v2.10.0
Loaded image: goharbor/redis-photon:v2.10.0
Loaded image: goharbor/registry-photon:v2.10.0
Loaded image: goharbor/harbor-portal:v2.10.0
Loaded image: goharbor/harbor-core:v2.10.0
Loaded image: goharbor/harbor-db:v2.10.0
Loaded image: goharbor/harbor-jobservice:v2.10.0
[Step 3]: preparing environment ...
[Step 4]: preparing harbor configs ...
prepare base dir is set to /home/harbor_v2.10.0/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/portal/nginx.conf
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/registryctl/config.yml
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
loaded secret from file: /data/secret/keys/secretkey
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir
Note: stopping existing Harbor instance ...
WARN[0000] /home/harbor_v2.10.0/harbor/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
[Step 5]: starting Harbor ...
WARN[0000] /home/liu/harbor_v2.10.0/harbor/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
[+] Running 10/10
✔ Network harbor_harbor Created 0.0s
✔ Container harbor-log Started 0.2s
✔ Container registryctl Started 0.3s
✔ Container redis Started 0.3s
✔ Container harbor-db Started 0.4s
✔ Container harbor-portal Started 0.4s
✔ Container registry Started 0.3s
✔ Container harbor-core Started 0.4s
✔ Container harbor-jobservice Started 0.5s
✔ Container nginx Started 0.6s
✔ ----Harbor has been installed and started successfully.----
/harbor$ sudo docker compose ps -a
WARN[0000] /home/harbor_v2.10.0/harbor/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
harbor-core goharbor/harbor-core:v2.10.0 "/harbor/entrypoint.…" core 11 seconds ago Up 10 seconds (health: starting)
harbor-db goharbor/harbor-db:v2.10.0 "/docker-entrypoint.…" postgresql 11 seconds ago Up 10 seconds (health: starting)
harbor-jobservice goharbor/harbor-jobservice:v2.10.0 "/harbor/entrypoint.…" jobservice 11 seconds ago Up 9 seconds (health: starting)
harbor-log goharbor/harbor-log:v2.10.0 "/bin/sh -c /usr/loc…" log 11 seconds ago Up 10 seconds (health: starting) 127.0.0.1:1514->10514/tcp
harbor-portal goharbor/harbor-portal:v2.10.0 "nginx -g 'daemon of…" portal 11 seconds ago Up 10 seconds (health: starting)
nginx goharbor/nginx-photon:v2.10.0 "nginx -g 'daemon of…" proxy 11 seconds ago Up 10 seconds (health: starting) 0.0.0.0:80->8080/tcp, [::]:80->8080/tcp
redis goharbor/redis-photon:v2.10.0 "redis-server /etc/r…" redis 11 seconds ago Up 10 seconds (health: starting)
registry goharbor/registry-photon:v2.10.0 "/home/harbor/entryp…" registry 11 seconds ago Up 10 seconds (health: starting)
registryctl goharbor/harbor-registryctl:v2.10.0 "/home/harbor/start.…" registryctl 11 seconds ago Up 10 seconds (health: starting)
/harbor$ cat harbor.yml # 仅截取了改动项
# 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.100 # 改为了宿主机IP地址
# http related config
http:
# port for http, default is 80. If https enabled, this port will redirect to https port
port: 80
# https related config
# https: # 用不到https, 所以注释掉
# https port for harbor, default is 443
# port: 443 # 用不到https, 所以注释掉
# The path of cert and key files for nginx
# certificate: /your/certificate/path # 用不到https, 所以注释掉
# private_key: /your/private/key/path # 用不到https, 所以注释掉
三、坑点,算不上大坑
- 宿主机 docker 命令无权限直接运行的, 所以在 bash install.sh时会出现运行权限问题, 所以直接 sudo bash install.sh就可以了
更多推荐
所有评论(0)