第一步:私有镜像仓库Harbor的安装部署

目的:相对于Docker Hub的公有仓库,Harbor是提供个人企业免费开源的私有仓库,可更好的保护和上传自制镜像
环境:CentOS 7主机系统
参考官网:
        Download the Harbor Installer
        harbor发行版安装包

一、相关包的下载

1、安装epel-release软件源

yum -y install epel-release

2、安装docker-compose

输入命令(速度较慢,若失败多试次)

curl -L https://github.com/docker/compose/releases/download/v2.21.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

打印返回

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 56.7M  100 56.7M    0     0  52736      0  0:18:49  0:18:49 --:--:-- 55319

2、harbor安装包的下载

2.1 方法一,去网页下载后传到该主机

harbor发行版安装包选择版本下载安装

2.2 方法二,执行wget下载

wget https://github.com/goharbor/harbor/releases/download/v2.3.3/harbor-offline-installer-v2.3.3.tgz

2.3 解压

tar -zxvf harbor-offline-installer-v2.3.3.tgz

二、安装配置

1、给docker-compose执行权

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

2、配置

2.1 进入harbor的解压目录

cd harbor

2.2 复制临时配置文件,或者重命名为harbor.yml

 cp harbor.yml.tmpl harbor.yml

2.3 修改harbor.yml

输入命令

vim harbor.yml

修改部分

# 改为自己的ip地址
hostname: 192.168.100.120 
# 屏蔽https的内容
#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
# 用户名为admin 密码 Harbor12345
harbor_admin_password: Harbor12345

2.4 执行安装(过程较慢)

输入命令

./install.sh

打印返回

[root@localhost harbor]# ./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: 2.21.0

[Step 2]: loading Harbor images ...

65e72028b01f: Loading layer [==================================================>]  37.22MB/37.22MB
e51669d52249: Loading layer [==================================================>]  8.746MB/8.746MB
b3d26a157680: Loading layer [==================================================>]  11.64MB/11.64MB
ec138b1109ab: Loading layer [==================================================>]  1.688MB/1.688MB
Loaded image: goharbor/harbor-portal:v2.3.3
f7d71543bc1d: Loading layer [==================================================>]  9.914MB/9.914MB
36c8f3e3c429: Loading layer [==================================================>]  3.584kB/3.584kB
8fcd87c7f05a: Loading layer [==================================================>]   2.56kB/2.56kB
cc22cd586a85: Loading layer [==================================================>]  73.35MB/73.35MB
6eb34fc63781: Loading layer [==================================================>]  5.632kB/5.632kB
94653af49aa5: Loading layer [==================================================>]   93.7kB/93.7kB
7cf3cd0bfc44: Loading layer [==================================================>]  11.78kB/11.78kB
e4878af2caa5: Loading layer [==================================================>]  74.25MB/74.25MB
aad522d6b0ab: Loading layer [==================================================>]   2.56kB/2.56kB
Loaded image: goharbor/harbor-core:v2.3.3
6ae6341f66eb: Loading layer [==================================================>]  134.8MB/134.8MB
3b4205a10935: Loading layer [==================================================>]  3.584kB/3.584kB
a850b04a24a9: Loading layer [==================================================>]  3.072kB/3.072kB
65bcebca3beb: Loading layer [==================================================>]   2.56kB/2.56kB
f63759473f5f: Loading layer [==================================================>]  3.072kB/3.072kB
8a56b631be4a: Loading layer [==================================================>]  3.584kB/3.584kB
d0bc3d691b7a: Loading layer [==================================================>]  19.97kB/19.97kB
Loaded image: goharbor/harbor-log:v2.3.3
20d32109e78b: Loading layer [==================================================>]  9.914MB/9.914MB
a2f32f09482a: Loading layer [==================================================>]  17.71MB/17.71MB
aa99dcbbe2a3: Loading layer [==================================================>]  4.608kB/4.608kB
547800c15f7c: Loading layer [==================================================>]   18.5MB/18.5MB
Loaded image: goharbor/harbor-exporter:v2.3.3
472f02def10d: Loading layer [==================================================>]  6.816MB/6.816MB
191c94eb283a: Loading layer [==================================================>]  6.219MB/6.219MB
6b3dd54289a8: Loading layer [==================================================>]  15.88MB/15.88MB
f8ee433b75f6: Loading layer [==================================================>]  29.29MB/29.29MB
dec9d26040fa: Loading layer [==================================================>]  22.02kB/22.02kB
34daa1f190e4: Loading layer [==================================================>]  15.88MB/15.88MB
Loaded image: goharbor/notary-server-photon:v2.3.3
ad19e2c06950: Loading layer [==================================================>]  6.816MB/6.816MB
945fce278a88: Loading layer [==================================================>]  6.219MB/6.219MB
acc1cb25f3ce: Loading layer [==================================================>]  14.47MB/14.47MB
7a6f02d3c52e: Loading layer [==================================================>]  29.29MB/29.29MB
53d056ede183: Loading layer [==================================================>]  22.02kB/22.02kB
498456562533: Loading layer [==================================================>]  14.47MB/14.47MB
Loaded image: goharbor/notary-signer-photon:v2.3.3
51cb158b9713: Loading layer [==================================================>]   6.82MB/6.82MB
e6165ffc0886: Loading layer [==================================================>]  67.47MB/67.47MB
0eea6880ad2b: Loading layer [==================================================>]  3.072kB/3.072kB
36c026a8dac4: Loading layer [==================================================>]  4.096kB/4.096kB
19d0df750aa3: Loading layer [==================================================>]  68.26MB/68.26MB
Loaded image: goharbor/chartmuseum-photon:v2.3.3
a0872a3f88df: Loading layer [==================================================>]  1.096MB/1.096MB
2b8d48b5f7c7: Loading layer [==================================================>]  5.888MB/5.888MB
ad905cf3a1a5: Loading layer [==================================================>]    183MB/183MB
f84b9ef01e55: Loading layer [==================================================>]  15.59MB/15.59MB
14f697c9fd55: Loading layer [==================================================>]  4.096kB/4.096kB
a202e8e3f0da: Loading layer [==================================================>]  6.144kB/6.144kB
776f6e1f67ab: Loading layer [==================================================>]  3.072kB/3.072kB
8643b56b215d: Loading layer [==================================================>]  2.048kB/2.048kB
bab53c5e367c: Loading layer [==================================================>]   2.56kB/2.56kB
79d344c9e509: Loading layer [==================================================>]   2.56kB/2.56kB
4617b16f20ea: Loading layer [==================================================>]   2.56kB/2.56kB
3416932ea58a: Loading layer [==================================================>]  8.704kB/8.704kB
Loaded image: goharbor/harbor-db:v2.3.3
35eb5a5faf13: Loading layer [==================================================>]  6.821MB/6.821MB
4aa5b9ade884: Loading layer [==================================================>]  4.096kB/4.096kB
7b5a794abd0b: Loading layer [==================================================>]  19.02MB/19.02MB
20cde1a949a9: Loading layer [==================================================>]  3.072kB/3.072kB
fd449fc699ad: Loading layer [==================================================>]  25.43MB/25.43MB
6d827096a056: Loading layer [==================================================>]  45.24MB/45.24MB
Loaded image: goharbor/harbor-registryctl:v2.3.3
3eda76466bec: Loading layer [==================================================>]  130.6MB/130.6MB
9cbeb3eb5055: Loading layer [==================================================>]  3.072kB/3.072kB
9a38627e2870: Loading layer [==================================================>]   59.9kB/59.9kB
ad0ed7ec2e59: Loading layer [==================================================>]  61.95kB/61.95kB
Loaded image: goharbor/redis-photon:v2.3.3
74091fea1265: Loading layer [==================================================>]  6.821MB/6.821MB
843394c6da0f: Loading layer [==================================================>]  4.096kB/4.096kB
bb0a5ff2fa1f: Loading layer [==================================================>]  3.072kB/3.072kB
61b2c36e04b1: Loading layer [==================================================>]  19.02MB/19.02MB
9c192b468053: Loading layer [==================================================>]  19.81MB/19.81MB
Loaded image: goharbor/registry-photon:v2.3.3
f21b010a959b: Loading layer [==================================================>]  9.914MB/9.914MB
667273a17250: Loading layer [==================================================>]  3.584kB/3.584kB
85b2c3f7c37e: Loading layer [==================================================>]   2.56kB/2.56kB
cf8a2e29273a: Loading layer [==================================================>]  82.47MB/82.47MB
3f2e9c55c29a: Loading layer [==================================================>]  83.26MB/83.26MB
Loaded image: goharbor/harbor-jobservice:v2.3.3
71d027ba4de6: Loading layer [==================================================>]  8.746MB/8.746MB
Loaded image: goharbor/nginx-photon:v2.3.3
fcd0cc088715: Loading layer [==================================================>]  174.4MB/174.4MB
a540ca5617b1: Loading layer [==================================================>]  55.75MB/55.75MB
be54866e3c0e: Loading layer [==================================================>]   2.56kB/2.56kB
d5e4815cd5bf: Loading layer [==================================================>]  1.536kB/1.536kB
96fd79b84e82: Loading layer [==================================================>]  12.29kB/12.29kB
21c6e3d8425f: Loading layer [==================================================>]  2.882MB/2.882MB
d9c6d9e17da6: Loading layer [==================================================>]    297kB/297kB
Loaded image: goharbor/prepare:v2.3.3
2f899218d2b6: Loading layer [==================================================>]  7.359MB/7.359MB
301671e975f5: Loading layer [==================================================>]  4.096kB/4.096kB
24b181880185: Loading layer [==================================================>]  3.072kB/3.072kB
007e67bf3a3e: Loading layer [==================================================>]  31.52MB/31.52MB
f8a68e126cbf: Loading layer [==================================================>]  11.39MB/11.39MB
85920120ad25: Loading layer [==================================================>]   43.7MB/43.7MB
Loaded image: goharbor/trivy-adapter-photon:v2.3.3


[Step 3]: preparing environment ...

[Step 4]: preparing harbor configs ...
prepare base dir is set to /home/test/linux/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
Generated and saved secret to file: /data/secret/keys/secretkey
Successfully called func: create_root_cert
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir



[Step 5]: starting Harbor ...
[+] Running 10/10
 ✔ Network harbor_harbor        Created                                                                                                                                                                                                6.4s 
 ✔ Container harbor-log         Started                                                                                                                                                                                                0.6s 
 ✔ Container harbor-portal      Started                                                                                                                                                                                                0.4s 
 ✔ Container redis              Started                                                                                                                                                                                                0.3s 
 ✔ Container registry           Started                                                                                                                                                                                                0.2s 
 ✔ Container registryctl        Started                                                                                                                                                                                                0.3s 
 ✔ Container harbor-db          Started                                                                                                                                                                                                0.3s 
 ✔ Container harbor-core        Started                                                                                                                                                                                                0.3s 
 ✔ Container nginx              Started                                                                                                                                                                                                0.7s 
 ✔ Container harbor-jobservice  Started                                                                                                                                                                                                0.7s 
✔ ----Harbor has been installed and started successfully.----
看到✔ ----Harbor has been installed and started successfully.
这句话,意味着安装成功,可在浏览器输入ip地址访问测试

第一步:私有镜像仓库Harbor的安装部署_第1张图片

你可能感兴趣的:(#,Docker,docker,容器,服务器,linux)