安装Harbor
[root@node1 ~]# cd /opt/
[root@node1 opt]# ls
[root@node1 opt]# sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Loaded plugins: fastestmirror
Determining fastest mirrors
epel/x86_64/metalink | 7.3 kB 00:00:00
- base: mirrors.aliyun.com
- epel: mirror.01link.hk
- extras: mirrors.ustc.edu.cn
- updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/3): epel/x86_64/updateinfo | 1.0 MB 00:00:00
(2/3): epel/x86_64/group_gz | 100 kB 00:00:02
(3/3): epel/x86_64/primary_db | 7.0 MB 00:00:02
Package yum-utils-1.1.31-54.el7_8.noarch already installed and latest version
Resolving Dependencies
–> Running transaction check
–> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================
Package Arch Version Repository Size
Updating:
device-mapper-persistent-data x86_64 0.8.5-3.el7_9.2 updates 423 k
lvm2 x86_64 7:2.02.187-6.el7_9.5 updates 1.3 M
Updating for dependencies:
device-mapper x86_64 7:1.02.170-6.el7_9.5 updates 297 k
device-mapper-event x86_64 7:1.02.170-6.el7_9.5 updates 192 k
device-mapper-event-libs x86_64 7:1.02.170-6.el7_9.5 updates 192 k
device-mapper-libs x86_64 7:1.02.170-6.el7_9.5 updates 325 k
lvm2-libs x86_64 7:2.02.187-6.el7_9.5 updates 1.1 M
Transaction Summary
Upgrade 2 Packages (+5 Dependent packages)
Total download size: 3.8 M
Downloading packages:
No Presto metadata available for updates
(1/7): device-mapper-event-libs-1.02.170-6.el7_9.5.x86_64.rpm | 192 kB 00:00:00
(2/7): device-mapper-event-1.02.170-6.el7_9.5.x86_64.rpm | 192 kB 00:00:00
(3/7): device-mapper-persistent-data-0.8.5-3.el7_9.2.x86_64.rpm | 423 kB 00:00:00
(4/7): device-mapper-libs-1.02.170-6.el7_9.5.x86_64.rpm | 325 kB 00:00:00
(5/7): lvm2-2.02.187-6.el7_9.5.x86_64.rpm | 1.3 MB 00:00:00
(6/7): device-mapper-1.02.170-6.el7_9.5.x86_64.rpm | 297 kB 00:00:00
(7/7): lvm2-libs-2.02.187-6.el7_9.5.x86_64.rpm | 1.1 MB 00:00:00
Total 4.0 MB/s | 3.8 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : 7:device-mapper-libs-1.02.170-6.el7_9.5.x86_64 1/14
Verifying : 7:device-mapper-1.02.170-6.el7.x86_64 14/14
Updated:
device-mapper-persistent-data.x86_64 0:0.8.5-3.el7_9.2 lvm2.x86_64 7:2.02.187-6.el7_9.5
Dependency Updated:
device-mapper.x86_64 7:1.02.170-6.el7_9.5 device-mapper-event.x86_64 7:1.02.170-6.el7_9.5
device-mapper-event-libs.x86_64 7:1.02.170-6.el7_9.5 device-mapper-libs.x86_64 7:1.02.170-6.el7_9.5
lvm2-libs.x86_64 7:2.02.187-6.el7_9.5
Complete!
[root@node1 opt]# sudo yum-config-manager –add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Loaded plugins: fastestmirror
adding repo from: https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
grabbing file https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
[root@node1 opt]# sudo sed -i ‘s+download.docker.com+mirrors.aliyun.com/docker-ce+’ /etc/yum.repos.d/docker-ce.repo
[root@node1 opt]# sudo yum makecache fast
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 7.3 kB 00:00:00
- base: mirrors.aliyun.com
- epel: mirror.01link.hk
- extras: mirrors.ustc.edu.cn
- updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/2): docker-ce-stable/7/x86_64/updateinfo | 55 B 00:00:00
(2/2): docker-ce-stable/7/x86_64/primary_db | 118 kB 00:00:00
Metadata Cache Created
[root@node1 opt]# sudo yum -y install docker-ce
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile - base: mirrors.aliyun.com
- epel: mirror.01link.hk
- extras: mirrors.ustc.edu.cn
- updates: mirrors.aliyun.com
Resolving Dependencies
—> Package fuse3-libs.x86_64 0:3.6.1-4.el7 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================
Package Arch Version Repository Size
Installing:
docker-ce x86_64 3:24.0.7-1.el7 docker-ce-stable 24 M
Installing for dependencies:
container-selinux noarch 2:2.119.2-1.911c772.el7_8 extras 40 k
containerd.io x86_64 1.6.26-3.1.el7 docker-ce-stable 35 M
docker-buildx-plugin x86_64 0.11.2-1.el7 docker-ce-stable 13 M
docker-ce-cli x86_64 1:24.0.7-1.el7 docker-ce-stable 13 M
docker-ce-rootless-extras x86_64 24.0.7-1.el7 docker-ce-stable 9.1 M
docker-compose-plugin x86_64 2.21.0-1.el7 docker-ce-stable 13 M
fuse-overlayfs x86_64 0.7.2-6.el7_8 extras 54 k
fuse3-libs x86_64 3.6.1-4.el7 extras 82 k
slirp4netns x86_64 0.4.3-4.el7_8 extras 81 k
Transaction Summary
Install 1 Package (+9 Dependent packages)
Total download size: 108 M
Installed size: 380 M
Downloading packages:
(1/10): container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm | 40 kB 00:00:00
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/docker-buildx-plugin-0.11.2-1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Public key for docker-buildx-plugin-0.11.2-1.el7.x86_64.rpm is not installed
(2/10): docker-buildx-plugin-0.11.2-1.el7.x86_64.rpm | 13 MB 00:00:13
(3/10): docker-ce-24.0.7-1.el7.x86_64.rpm | 24 MB 00:00:23
(4/10): containerd.io-1.6.26-3.1.el7.x86_64.rpm | 35 MB 00:00:43
(5/10): docker-ce-cli-24.0.7-1.el7.x86_64.rpm | 13 MB 00:00:15
(6/10): slirp4netns-0.4.3-4.el7_8.x86_64.rpm | 81 kB 00:00:00
(7/10): fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm | 54 kB 00:00:00
(8/10): fuse3-libs-3.6.1-4.el7.x86_64.rpm | 82 kB 00:00:03
(9/10): docker-ce-rootless-extras-24.0.7-1.el7.x86_64.rpm | 9.1 MB 00:00:12
(10/10): docker-compose-plugin-2.21.0-1.el7.x86_64.rpm | 13 MB 00:00:10
Total 1.7 MB/s | 108 MB 00:01:02
Retrieving key from https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
Importing GPG key 0x621E9F35:
Userid : “Docker Release (CE rpm) docker@docker.com“
Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
From : https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
Running transaction check
Verifying : fuse-overlayfs-0.7.2-6.el7_8.x86_64 10/10
Installed:
docker-ce.x86_64 3:24.0.7-1.el7
Dependency Installed:
container-selinux.noarch 2:2.119.2-1.911c772.el7_8 containerd.io.x86_64 0:1.6.26-3.1.el7
docker-buildx-plugin.x86_64 0:0.11.2-1.el7 docker-ce-cli.x86_64 1:24.0.7-1.el7
docker-ce-rootless-extras.x86_64 0:24.0.7-1.el7 docker-compose-plugin.x86_64 0:2.21.0-1.el7
fuse-overlayfs.x86_64 0:0.7.2-6.el7_8 fuse3-libs.x86_64 0:3.6.1-4.el7
slirp4netns.x86_64 0:0.4.3-4.el7_8
Complete!
[root@node1 opt]# sudo service docker start
Redirecting to /bin/systemctl start docker.service
[root@node1 opt]# curl -L “https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose
curl: (1) Protocol “https not supported or disabled in libcurl
[root@node1 opt]# wget https://github.com/goharbor/harbor/releases/download/v2.4.0/harbor-online-installer-v2.4.0.tgz
-bash: wget: command not found
[root@node1 opt]# yum install -y wget
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
- base: mirrors.aliyun.com
- epel: mirror.01link.hk
- extras: mirrors.ustc.edu.cn
- updates: mirrors.aliyun.com
Resolving Dependencies
–> Running transaction check
—> Package wget.x86_64 0:1.14-18.el7_6.1 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================
Package Arch Version Repository Size
Installing:
wget x86_64 1.14-18.el7_6.1 base 547 k
Transaction Summary
Install 1 Package
Total download size: 547 k
Installed size: 2.0 M
Downloading packages:
wget-1.14-18.el7_6.1.x86_64.rpm | 547 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : wget-1.14-18.el7_6.1.x86_64 1/1
Verifying : wget-1.14-18.el7_6.1.x86_64 1/1
Installed:
wget.x86_64 0:1.14-18.el7_6.1
Complete!
[root@node1 opt]# wget https://github.com/goharbor/harbor/releases/download/v2.4.0/harbor-online-installer-v2.4.0.tgz
–2024-01-08 01:13:01– https://github.com/goharbor/harbor/releases/download/v2.4.0/harbor-online-installer-v2.4.0.tgz
Resolving github.com (github.com)… 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443… connected.
HTTP request sent, awaiting response… 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/50613991/1292baa8-e4ac-4864-aed5-ed4313a80fbc?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240108%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240108T061302Z&X-Amz-Expires=300&X-Amz-Signature=dd33d60e96887b8663624070723ef7a2cd1a9cdb1373fab18f7b9bb0bf33f8e0&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=50613991&response-content-disposition=attachment%3B%20filename%3Dharbor-online-installer-v2.4.0.tgz&response-content-type=application%2Foctet-stream [following]
–2024-01-08 01:13:02– https://objects.githubusercontent.com/github-production-release-asset-2e65be/50613991/1292baa8-e4ac-4864-aed5-ed4313a80fbc?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240108%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240108T061302Z&X-Amz-Expires=300&X-Amz-Signature=dd33d60e96887b8663624070723ef7a2cd1a9cdb1373fab18f7b9bb0bf33f8e0&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=50613991&response-content-disposition=attachment%3B%20filename%3Dharbor-online-installer-v2.4.0.tgz&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)… 185.199.109.133, 185.199.108.133, 185.199.111.133, …
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.109.133|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 9840 (9.6K) [application/octet-stream]
Saving to: ‘harbor-online-installer-v2.4.0.tgz’
100%[=========================================================================================>] 9,840 –.-K/s in 0.01s
2024-01-08 01:13:04 (727 KB/s) – ‘harbor-online-installer-v2.4.0.tgz’ saved [9840/9840]
[root@node1 opt]# tar -xf harbor-online-installer-v2.4.0.tgz -C /opt
[root@node1 opt]#
[root@node1 opt]# cp /opt/harbor/harbor.yml.tmpl /opt/harbor/harbor.yml
[root@node1 opt]# vi /opt/harbor/harbor.yml
hostname: reg.mydomain.com 修改为使用域名 没有域名可直接使用ip
不使用https
需要将https配置文件注释掉 不然无法启动
harbor_admin_password: Harbor12345 #默认密码 可修改 默认账号为admin
执行./prepare && install.sh #运行容器即可登录harbor
[root@node1 opt]#
[root@node1 opt]# ls
containerd harbor harbor-online-installer-v2.4.0.tgz
[root@node1 opt]# cd harbor
[root@node1 harbor]# ls
common.sh harbor.yml harbor.yml.tmpl install.sh LICENSE prepare
[root@node1 harbor]# ./prepare && install.sh
prepare base dir is set to /opt/harbor
Unable to find image ‘goharbor/prepare:v2.4.0’ locally
v2.4.0: Pulling from goharbor/prepare
f46a0e9c442c: Pull complete
7e931ef2b2a4: Pull complete
81f51b80102b: Pull complete
29cc34051f9e: Pull complete
8b49406ca171: Pull complete
cdece38b7418: Pull complete
91a66d468cce: Pull complete
98764516aa60: Pull complete
Digest: sha256:bd88e782e9956d07f5196067c63cd46f9e792e9e59128fb2bd9d49d250e0aeb4
Status: Downloaded newer image for goharbor/prepare:v2.4.0
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
Successfully called func: create_root_cert
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir
-bash: install.sh: command not found
[root@node1 harbor]# sh install.sh
[Step 0]: checking if docker is installed …
Note: docker version: 24.0.7
[Step 1]: checking docker-compose is installed …
✖ Need to install docker-compose(1.18.0+) by yourself first and run this script again.
[root@node1 harbor]# yum install docker-compose* -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
- base: mirrors.aliyun.com
- epel: mirror.01link.hk
- extras: mirrors.ustc.edu.cn
- updates: mirrors.aliyun.com
No package docker-compose.yml available.
Error: Nothing to do
[root@node1 harbor]# yum install docker-compose -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile - base: mirrors.aliyun.com
- epel: mirror.01link.hk
- extras: mirrors.ustc.edu.cn
–> Running transaction check
—> Package libtirpc.x86_64 0:0.2.4-0.16.el7 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================
Package Arch Version Repository Size
Installing:
docker-compose noarch 1.18.0-4.el7 epel 222 k
Installing for dependencies:
python36-websocket-client noarch 0.47.0-2.el7 epel 59 k
Transaction Summary
Install 1 Package (+20 Dependent packages)
Total download size: 11 M
Installed size: 55 M
Downloading packages:
(19/21): python36-texttable-1.6.2-1.el7.noarch.rpm | 23 kB 00:00:00
(20/21): python36-urllib3-1.25.6-2.el7.noarch.rpm | 178 kB 00:00:00
(21/21): python36-websocket-client-0.47.0-2.el7.noarch.rpm | 59 kB 00:00:00
Total 1.8 MB/s | 11 MB 00:00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libtirpc-0.2.4-0.16.el7.x86_64 1/21
Installing : python3-pip-9.0.3-8.el7.noarch 2/21
Installing : python3-setuptools-39.2.0-10.el7.noarch 3/21
Installing : python3-3.6.8-21.el7_9.x86_64 4/21
Installing : python3-libs-3.6.8-21.el7_9.x86_64 5/21
Verifying : python36-docopt-0.6.2-8.el7.noarch 17/21
Verifying : python36-cached_property-1.5.1-2.el7.noarch 18/21
Verifying : python36-six-1.14.0-3.el7.noarch 19/21
Verifying : python36-websocket-client-0.47.0-2.el7.noarch 20/21
Verifying : python36-texttable-1.6.2-1.el7.noarch 21/21
Installed:
docker-compose.noarch 0:1.18.0-4.el7
Dependency Installed:
libtirpc.x86_64 0:0.2.4-0.16.el7 python3.x86_64 0:3.6.8-21.el7_9
python3-libs.x86_64 0:3.6.8-21.el7_9 python3-pip.noarch 0:9.0.3-8.el7
python3-setuptools.noarch 0:39.2.0-10.el7 python36-PyYAML.x86_64 0:3.13-1.el7
python36-cached_property.noarch 0:1.5.1-2.el7 python36-chardet.noarch 0:3.0.4-1.el7
python36-docker.noarch 0:2.6.1-3.el7 python36-docker-pycreds.noarch 0:0.2.1-2.el7
python36-dockerpty.noarch 0:0.4.1-18.el7 python36-docopt.noarch 0:0.6.2-8.el7
python36-idna.noarch 0:2.10-1.el7 python36-jsonschema.noarch 0:2.5.1-4.el7
python36-pysocks.noarch 0:1.6.8-7.el7 python36-requests.noarch 0:2.14.2-2.el7
python36-six.noarch 0:1.14.0-3.el7 python36-texttable.noarch 0:1.6.2-1.el7
python36-urllib3.noarch 0:1.25.6-2.el7 python36-websocket-client.noarch 0:0.47.0-2.el7
Complete!
[root@node1 harbor]# sh install.sh
[Step 0]: checking if docker is installed …
Note: docker version: 24.0.7
[Step 1]: checking docker-compose is installed …
Note: docker-compose version: 1.18.0
[Step 2]: preparing environment …
[Step 3]: preparing harbor configs …
prepare base dir is set to /opt/harbor
WARNING:root:WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https
Clearing the configuration file: /config/portal/nginx.conf
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/log/rsyslog_docker.conf
Clearing the configuration file: /config/nginx/nginx.conf
Clearing the configuration file: /config/core/env
Clearing the configuration file: /config/core/app.conf
Clearing the configuration file: /config/registry/passwd
Clearing the configuration file: /config/registry/config.yml
Clearing the configuration file: /config/registryctl/env
Clearing the configuration file: /config/registryctl/config.yml
Clearing the configuration file: /config/db/env
Clearing the configuration file: /config/jobservice/env
Clearing the configuration file: /config/jobservice/config.yml
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
[Step 4]: starting Harbor …
Creating network “harbor_harbor” with the default driver
Pulling log (goharbor/harbor-log:v2.4.0)…
v2.4.0: Pulling from goharbor/harbor-log
f46a0e9c442c: Already exists
3c6192720cd5: Pull complete
8ebd7b743ab8: Pull complete
ac4b18556c88: Pull complete
106c5a16cbb9: Pull complete
af096efd93a4: Pull complete
8c51f215dfaa: Pull complete
bb41a1a15c14: Pull complete
Digest: sha256:ef5d06ff97b97b8021cca45e38b75d3ddd73d8c0d472877d0ec1b7f3858d2dcc
Status: Downloaded newer image for goharbor/harbor-log:v2.4.0
Pulling registry (goharbor/registry-photon:v2.4.0)…
v2.4.0: Pulling from goharbor/registry-photon
f46a0e9c442c: Already exists
990a74df6308: Pull complete
39c4479300aa: Pull complete
a86e5ab96782: Pull complete
a16a8b5a8999: Pull complete
a66577878462: Pull complete
Digest: sha256:1912082d0461cecdc6332bd2a9fcaefa38340b1decbed82e327c2bb542790e0b
Status: Downloaded newer image for goharbor/registry-photon:v2.4.0
Pulling registryctl (goharbor/harbor-registryctl:v2.4.0)…
v2.4.0: Pulling from goharbor/harbor-registryctl
f46a0e9c442c: Already exists
1fb6350bbc65: Pull complete
4ddddf49da0a: Pull complete
7be1e2d2849d: Pull complete
49b544808edc: Pull complete
ebaad823fca2: Pull complete
8255a492fa7c: Pull complete
Digest: sha256:6e9920a493607cdb5c9026c29be206619e62b6fdd57d8fd4d5f2a0ce98b164fc
Status: Downloaded newer image for goharbor/harbor-registryctl:v2.4.0
Pulling postgresql (goharbor/harbor-db:v2.4.0)…
v2.4.0: Pulling from goharbor/harbor-db
f46a0e9c442c: Already exists
c34c5b15c5e6: Pull complete
16aa95ef3f5f: Pull complete
47b90d7c3a17: Pull complete
c1c14c642a55: Pull complete
70f3c1a3db88: Pull complete
77ef1bc45e12: Pull complete
b427492fd8f5: Pull complete
4361b72d7b3b: Pull complete
4da4f67e084a: Pull complete
5baeb6d660a5: Pull complete
71a0f1586125: Pull complete
dbd2a9698c0f: Pull complete
Digest: sha256:4391e0361a5ef3228a8eca800e5a05dc0c44eca0c8cccea01582195eea0ceea7
Status: Downloaded newer image for goharbor/harbor-db:v2.4.0
Pulling portal (goharbor/harbor-portal:v2.4.0)…
v2.4.0: Pulling from goharbor/harbor-portal
f46a0e9c442c: Already exists
5665a27c06e8: Pull complete
dc2912de318e: Pull complete
722989e6785c: Pull complete
Digest: sha256:55d776fc7f431cdd008c3d8fc3e090c81c1368ed9ed85335f4664df71f864f0d
Status: Downloaded newer image for goharbor/harbor-portal:v2.4.0
Pulling redis (goharbor/redis-photon:v2.4.0)…
v2.4.0: Pulling from goharbor/redis-photon
f46a0e9c442c: Already exists
d7555d311ed5: Pull complete
4912ff6c3bed: Pull complete
b67940bafd3c: Pull complete
45d6a4928c10: Pull complete
Digest: sha256:99d0e746b32d6801c82022be675ac6702a0ae92ff4f4a6492e735967d37ccab9
Status: Downloaded newer image for goharbor/redis-photon:v2.4.0
Pulling core (goharbor/harbor-core:v2.4.0)…
v2.4.0: Pulling from goharbor/harbor-core
f46a0e9c442c: Already exists
4865e3c1737c: Pull complete
bbdd364b96ca: Pull complete
d9da9c541483: Pull complete
56b933da039f: Pull complete
94615577bd71: Pull complete
10ff2215d167: Pull complete
a6f872747a49: Pull complete
732908499d82: Pull complete
f05e42eb706b: Pull complete
Digest: sha256:b5e1bf10c22df2b59a7a79623e6f857a797b4c7ca32326611b3c707f0a4e6e22
Status: Downloaded newer image for goharbor/harbor-core:v2.4.0
Pulling jobservice (goharbor/harbor-jobservice:v2.4.0)…
v2.4.0: Pulling from goharbor/harbor-jobservice
f46a0e9c442c: Already exists
d2d1323cb634: Pull complete
0b931f0c8713: Pull complete
161fdc5fef02: Pull complete
f599424a6ab9: Pull complete
308ee8379458: Pull complete
Creating harbor-log … done
Status: Downloaded newer image for goharbor/harbor-jobservice:v2.4.0
Pulling proxy (goharbor/nginx-photon:v2.4.0)…
v2.4.0: Pulling from goharbor/nginx-photon
f46a0e9c442c: Already exists
Creating registry … done
Creating harbor-core … done
Status: Downloaded newer image for goharbor/nginx-photon:v2.4.0
Creating nginx … error
Creating redis …
Creating registry …
Creating harbor-db …
Creating harbor-jobservice … done
Creating harbor-portal …
Creating harbor-core …
Creating nginx …
Creating harbor-jobservice …
ERROR: for nginx Cannot start service proxy: driver failed programming external connectivity on endpoint nginx (591d6507b530e606cfef4e8cf1427bcc958d8344db707051784c650b43453a1f): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use
ERROR: for proxy Cannot start service proxy: driver failed programming external connectivity on endpoint nginx (591d6507b530e606cfef4e8cf1427bcc958d8344db707051784c650b43453a1f): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use
ERROR: Encountered errors while bringing up the project.
[root@node1 harbor]# netstat -tnpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:25151 0.0.0.0:* LISTEN 942/python2
tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN 662/rsync
tcp 0 0 127.0.0.1:1514 0.0.0.0:* LISTEN 2148/docker-proxy
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 941/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1132/master
tcp6 0 0 :::873 :::* LISTEN 662/rsync
tcp6 0 0 :::80 :::* LISTEN 939/httpd
tcp6 0 0 :::22 :::* LISTEN 941/sshd
tcp6 0 0 ::1:25 :::* LISTEN 1132/master
tcp6 0 0 :::443 :::* LISTEN 939/httpd
[root@node1 harbor]# kill -9 939
[root@node1 harbor]# nginx -s
-bash: nginx: command not found
[root@node1 harbor]# nginx
-bash: nginx: command not found
[root@node1 harbor]# service start nginx
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
[root@node1 harbor]# service nginx start
Redirecting to /bin/systemctl start nginx.service
Failed to start nginx.service: Unit not found.
[root@node1 harbor]#
[root@node1 harbor]#
[root@node1 harbor]# sh install.sh
[Step 0]: checking if docker is installed …
Note: docker version: 24.0.7
[Step 1]: checking docker-compose is installed …
Note: docker-compose version: 1.18.0
[Step 2]: preparing environment …
[Step 3]: preparing harbor configs …
prepare base dir is set to /opt/harbor
WARNING:root:WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https
Clearing the configuration file: /config/portal/nginx.conf
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/log/rsyslog_docker.conf
Clearing the configuration file: /config/nginx/nginx.conf
Clearing the configuration file: /config/core/env
Clearing the configuration file: /config/core/app.conf
Clearing the configuration file: /config/registry/passwd
Clearing the configuration file: /config/registry/config.yml
Clearing the configuration file: /config/registry/root.crt
Clearing the configuration file: /config/registryctl/env
Clearing the configuration file: /config/registryctl/config.yml
Clearing the configuration file: /config/db/env
Clearing the configuration file: /config/jobservice/env
Clearing the configuration file: /config/jobservice/config.yml
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 …
Stopping harbor-jobservice … done
Stopping harbor-core … done
Stopping harbor-portal … done
Stopping registryctl … done
Stopping registry … done
Stopping harbor-db … done
Stopping redis … done
Stopping harbor-log … done
Removing harbor-jobservice … done
Removing nginx … done
Removing harbor-core … done
Removing harbor-portal … done
Removing registryctl … done
Removing registry … done
Creating harbor-log … done
Removing redis … done
Removing harbor-log … done
Removing network harbor_harbor
Creating registry … done
Creating harbor-core … done
Creating network “harbor_harbor” with the default driver
Creating harbor-jobservice … done
Creating redis …
Creating registry …
Creating harbor-db …
Creating registryctl …
Creating harbor-portal …
Creating harbor-core …
Creating nginx …
Creating harbor-jobservice …
✔ —-Harbor has been installed and started successfully.—-
[root@node1 harbor]# history
121 cd /opt/
122 ls
123 sudo yum install -y yum-utils device-mapper-persistent-data lvm2
124 sudo yum-config-manager –add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
125 sudo sed -i ‘s+download.docker.com+mirrors.aliyun.com/docker-ce+’ /etc/yum.repos.d/docker-ce.repo
126 sudo yum makecache fast
127 sudo yum -y install docker-ce
128 udo service docker start
129 curl -L “https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose
130 wget https://github.com/goharbor/harbor/releases/download/v2.4.0/harbor-online-installer-v2.4.0.tgz
131 yum install -y wget
132 wget https://github.com/goharbor/harbor/releases/download/v2.4.0/harbor-online-installer-v2.4.0.tgz
133 tar -xf harbor-online-installer-v2.4.0.tgz -C /opt
134 cpopt/harbor/harbor.yml.tmpl /opt/harbor/harbor.yml
135 vi /opt/harbor/harbor.yml
136 ls
137 cd harbor
138 ls
139 ./prepare && install.sh
140 sh install.sh
141 yum install docker-compose* -y
142 yum install docker-compose -y
143 sh install.sh
144 netstat -tnpl
145 kill -9 939
146 nginx -s
147 nginx
148 service start nginx
149 service nginx start
150 sh install.sh
151 history
[root@node1 harbor]#

