0%

Harbor镜像仓库安装

Harbor镜像仓库安装

Harbor是由VMware公司开源的企业级的Docker Registry管理项目

https://goharbor.io/

下载安装包

https://github.com/goharbor/harbor/releases

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

安装基础环境

Install Docker Engine on CentOS

https://docs.docker.com/engine/install/centos/

1
2
3
4
5
6
yum install -y yum-utils
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo

yum install -y docker-ce docker-ce-cli containerd.io
1
2
#安装慢的话 可以试下
curl -sSL https://get.daocloud.io/docker | sh
1
2
3
启动docker,配置自启动
systemctl enable docker
systemctl start docker

Docker compose

1
2
3
4
curl -L https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose

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

修改配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
hostname: harbor.zhaohongye.com
http:
port: 80
https:
port: 443
certificate: /data/servers/harbor/ssl/zhaohongye.com.crt
private_key: /data/servers/harbor/ssl/zhaohongye.com.key
harbor_admin_password: Harbor12345
database:
password: root123
max_idle_conns: 100
max_open_conns: 900
data_volume: /data/servers/harbor_data
trivy:
ignore_unfixed: false
skip_update: false
insecure: false
jobservice:
max_job_workers: 10
notification:
webhook_job_max_retry: 10
chart:
absolute_url: disabled
log:
level: info
local:
rotate_count: 50
rotate_size: 200M
location: /var/log/harbor
_version: 2.3.0
proxy:
http_proxy:
https_proxy:
no_proxy:
components:
- core
- jobservice
- trivy

执行安装脚本

1
./install.sh

启停

1
2
3
cd /data/servers/harbor
docker-compose start
docker-compose stop

查看容器状态

访问项目