服务器之家

服务器之家 > 正文

docker5 全功能harbor仓库搭建过程

时间:2021-08-13 18:00     来源/作者:Awesome Wang

harbor是一个用于存储和分发docker镜像的企业级registry服务器,可以用来构建企业内部的docker镜像仓库。它在docker的开源项目 distribution的基础上,添加了一些企业需要的功能特性,如镜像同步复制、漏洞扫描和权限管理等。harbor是由vmware公司开源的企业级的docker registry管理项目,它包括权限管理(rbac)、ldap、日志审核、管理界面、自我注册、镜像复制和中文支持等功能。

搭建一个全功能的仓库,且支持匿名拉取

?
1
2
3
4
5
6
[root@server1 mnt]# cd compose/
[root@server1 compose]# ls
docker-compose-linux-x86_64-1.16.1  docker-compose-linux-x86_64-1.24.1
docker-compose-linux-x86_64-1.22.0  docker-compose-linux-x86_64-1.27.0
[root@server1 compose]# mv docker-compose-linux-x86_64-1.27.0 /usr/local/bin/docker-compose
[root@server1 compose]# chmod +x /usr/local/bin/docker-compose
?
1
[root@server1 mnt]# tar zxf harbor-offline-installer-v1.10.1.tgz

解决依赖性,解压harbor

?
1
vim harbor.yml

在harbor的目录中

docker5 全功能harbor仓库搭建过程

认证和密钥的位置一定要写对

?
1
./install.sh

执行脚本安装

?
1
2
3
4
5
creating redis         ... done
creating harbor-core   ... done
creating nginx             ... done
creating harbor-jobservice ... done
✔ ----harbor has been installed and started successfully.----

done

?
1
[root@server1 harbor]# docker-compose

docker-compose命令一定要在harbor目录中执行

?
1
[root@server1 harbor]# docker-compose start
?
1
2
3
4
5
6
7
8
9
10
11
12
13
[root@server1 harbor]# docker-compose ps
      name                     command                  state                                        ports                                 
--------------------------------------------------------------------------------------------------------------------------------------------
harbor-core         /harbor/harbor_core              up (healthy)                                                                          
harbor-db           /docker-entrypoint.sh            up (healthy)   5432/tcp                                                               
harbor-jobservice   /harbor/harbor_jobservice  ...   up (healthy)                                                                          
harbor-log          /bin/sh -c /usr/local/bin/ ...   up (healthy)   127.0.0.1:1514->10514/tcp                                              
harbor-portal       nginx -g daemon off;             up (healthy)   8080/tcp                                                               
nginx               nginx -g daemon off;             up (healthy)   0.0.0.0:80->8080/tcp,:::80->8080/tcp,                                  
                                                                    0.0.0.0:443->8443/tcp,:::443->8443/tcp                                 
redis               redis-server /etc/redis.conf     up (healthy)   6379/tcp                                                               
registry            /home/harbor/entrypoint.sh       up (healthy)   5000/tcp                                                               
registryctl         /home/harbor/start.sh            up (healthy)

确保镜像都是up的状态
直接在浏览器输入ip地址

docker5 全功能harbor仓库搭建过程

用户admin,密码yume

docker5 全功能harbor仓库搭建过程

?
1
2
3
4
5
6
7
8
9
10
[root@server1 docker]# docker logout reg.westos.org
removing login credentials for reg.westos.org
[root@server1 docker]# docker login reg.westos.org
username: admin
password:
warning! your password will be stored unencrypted in /root/.docker/config.json.
configure a credential helper to remove this warning. see
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
 
login succeeded

退出之前的登录,重新登录
这是在数据库里保存的信息。
并非之前自己在本地创建的

?
1
2
3
4
5
6
7
8
9
[root@server1 docker]# docker tag yakexi007/game2048:latest reg.westos.org/library/game2048:latest
[root@server1 docker]# docker push reg.westos.org/library/game2048:latest 
the push refers to repository [reg.westos.org/library/game2048]
88fca8ae768a: pushed
6d7504772167: pushed
192e9fad2abc: pushed
36e9226e74f8: pushed
011b303988d2: pushed
latest: digest: sha256:8a34fb9cb168c420604b6e5d32ca6d412cb0d533a826b313b190535c03fe9390 size: 1364

给仓库上传,查看

docker5 全功能harbor仓库搭建过程

?
1
2
3
4
[root@server2 docker]# cat daemon.json
{
  "registry-mirrors": ["https://reg.westos.org"]
}

server2中,已经指向了私有仓库

?
1
2
3
4
5
6
7
8
registry: https://index.docker.io/v1/
 labels:
 experimental: false
 insecure registries:
  127.0.0.0/8
 registry mirrors:
  https://reg.westos.org/
 live restore enabled: false

且是生效的
在server2中做地址解析

docker5 全功能harbor仓库搭建过程

?
1
2
3
4
5
6
7
8
9
10
[root@server2 docker]# docker pull reg.westos.org/library/game2048:latest
latest: pulling from library/game2048
534e72e7cedc: pull complete
f62e2f6dfeef: pull complete
fe7db6293242: pull complete
3f120f6a2bf8: pull complete
4ba4e6930ea5: pull complete
digest: sha256:8a34fb9cb168c420604b6e5d32ca6d412cb0d533a826b313b190535c03fe9390
status: downloaded newer image for reg.westos.org/library/game2048:latest
reg.westos.org/library/game2048:latest

把server1push出去的镜像在server2pull下来
成功

docker5 全功能harbor仓库搭建过程

日志中可以看到,匿名用户进行了拉取

?
1
2
3
4
5
6
7
[root@server1 docker]# docker tag yakexi007/nginx:latest reg.westos.org/library/nginx:latest
[root@server1 docker]# docker push reg.westos.org/library/nginx
the push refers to repository [reg.westos.org/library/nginx]
3bd8699f28ba: pushed
1d3b68b6972f: pushed
de1602ca36c9: pushed
latest: digest: sha256:5ea5a786e978abd8e6e0b6c0f37f7271be19c40d6b8247b1d9dae70c1fbab9eb size: 949

server1中再次上传一个nginx镜像

docker5 全功能harbor仓库搭建过程

可以查看到

?
1
2
3
4
5
6
7
8
9
[root@server2 docker]# docker pull nginx
using default tag: latest
latest: pulling from library/nginx
cfb92865f5ba: pull complete
8dd350b5e0d5: pull complete
15157df2751c: pull complete
digest: sha256:5ea5a786e978abd8e6e0b6c0f37f7271be19c40d6b8247b1d9dae70c1fbab9eb
status: downloaded newer image for nginx:latest
docker.io/library/nginx:latest

server2再次拉取nginx,done
2.使用harbor仓库,一些基本的指令

?
1
[root@server1 harbor]# docker-compose logs

查看日志

?
1
[root@server1 harbor]# docker-compose stop

停用仓库
3.维护仓库(添加仓库模块:自动扫描镜像、签名功能)
先停掉仓库stop

?
1
[root@server1 harbor]# docker-compose rm

删除所有的容器
接下来,添加harbor的功能
查看安装脚本的help,可以看到3个模块:镜像漏洞扫描,内容信任,远程登陆
在安装脚本后面加上模块名称,重新安装后,会开启这些模块功能

?
1
2
3
4
5
6
[root@server1 harbor]# ./install.sh --help
 
note: please set hostname and other necessary attributes in harbor.yml first. do not use localhost or 127.0.0.1 for hostname, because harbor needs to be accessed by external clients.
please set --with-notary if needs enable notary in harbor, and set ui_url_protocol/ssl_cert/ssl_cert_key in harbor.yml bacause notary must run under https.
please set --with-clair if needs enable clair in harbor
please set --with-chartmuseum if needs enable chartmuseum in harbor
?
1
[root@server1 harbor]# ./install.sh --with-notary --with-clair --with-chartmuseum
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[step 5]: starting harbor ...
creating network "harbor_harbor-clair" with the default driver
creating network "harbor_harbor-notary" with the default driver
creating network "harbor_harbor-chartmuseum" with the default driver
creating network "harbor_notary-sig" with the default driver
creating harbor-log ... done
creating registry      ... done
creating harbor-db     ... done
creating registryctl   ... done
creating redis         ... done
creating chartmuseum   ... done
creating harbor-portal ... done
creating harbor-core   ... done
creating notary-signer ... done
creating clair         ... done
creating clair-adapter     ... done
creating notary-server     ... done
creating nginx             ... done
creating harbor-jobservice ... done
✔ ----harbor has been installed and started successfully.----
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[root@server1 harbor]# docker-compose ps
      name                     command                       state                                        ports                            
--------------------------------------------------------------------------------------------------------------------------------------------
chartmuseum         ./docker-entrypoint.sh           up (health: starting)   9999/tcp                                                      
clair               ./docker-entrypoint.sh           up (health: starting)   6060/tcp, 6061/tcp                                            
clair-adapter       /clair-adapter/clair-adapter     up (health: starting)   8080/tcp                                                      
harbor-core         /harbor/harbor_core              up (health: starting)                                                                 
harbor-db           /docker-entrypoint.sh            up (health: starting)   5432/tcp                                                      
harbor-jobservice   /harbor/harbor_jobservice  ...   up (health: starting)                                                                 
harbor-log          /bin/sh -c /usr/local/bin/ ...   up (health: starting)   127.0.0.1:1514->10514/tcp                                     
harbor-portal       nginx -g daemon off;             up (health: starting)   8080/tcp                                                      
nginx               nginx -g daemon off;             up (health: starting)   0.0.0.0:4443->4443/tcp,:::4443->4443/tcp,                     
                                                                             0.0.0.0:80->8080/tcp,:::80->8080/tcp,                         
                                                                             0.0.0.0:443->8443/tcp,:::443->8443/tcp                        
notary-server       /bin/sh -c migrate-patch - ...   up                                                                                    
notary-signer       /bin/sh -c migrate-patch - ...   up                                                                                    
redis               redis-server /etc/redis.conf     up (health: starting)   6379/tcp                                                      
registry            /home/harbor/entrypoint.sh       up (health: starting)   5000/tcp                                                      
registryctl         /home/harbor/start.sh            up (health: starting)

用ps查看,会发现多了一些功能
登录172.25.250.11

docker5 全功能harbor仓库搭建过程
docker5 全功能harbor仓库搭建过程

这些都是重新安装前没有的

–with-notary --with-clair --with-chartmuseum
分别是内容信任,镜像扫描和charts库
在浏览器查看镜像的信息
此时,可以看到镜像后面都跟有扫描、签名等信息
因为,配置这个目录时,没有开启镜像扫描和签名功能,所以,当前显示镜像是无扫描和无签名的

docker5 全功能harbor仓库搭建过程

如何自动扫描镜像?

docker5 全功能harbor仓库搭建过程

选中记得保存
尝试一下,重新上传一个镜像试试

?
1
[root@server1 harbor]# docker tag rhel7:latest reg.westos.org/library/rhel7:latest

这次用rhel7的镜像,先改一个名字

?
1
2
3
4
[root@server1 harbor]# docker push reg.westos.org/library/rhel7:latest
the push refers to repository [reg.westos.org/library/rhel7]
18af9eb19b5f: pushed
latest: digest: sha256:58cd9120a4194edb0de4377b71bd564953255a1422baa1bbd9cb23d521c6873b size: 528

上传到harbor

docker5 全功能harbor仓库搭建过程

当打开浏览器时,发现已经自动扫描过了

如何实现镜像签名功能?

docker5 全功能harbor仓库搭建过程

当选中了内容信任,此时在server2尝试拉取刚才上传的rhel7镜像

?
1
2
3
[root@server2 ~]# docker pull rhel7
using default tag: latest
error response from daemon: pull access denied for rhel7, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

如果取消选中内容信任就可以正常拉取
因为仓库开启了内容信任功能,客户端只能下载具有签名的镜像,而现在仓库中的debian镜像没有签名,因此,客户端拉取失败。
虽然拉取harbor仓库失败,但是,系统会自动到互联网上去拉取镜像(现在处于未联网的环境,所以,出现以上错误)

现在要给信任的镜像签名授权
先在web界面删除之前上传的,没有签名的镜像
在docker的服务端设置2个环境变量,即可使用内容信任功能为上传的镜像进行签名
(1)部署根证书

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[root@server1 harbor]# docker-compose ps
      name                     command                  state                                        ports                                 
--------------------------------------------------------------------------------------------------------------------------------------------
chartmuseum         ./docker-entrypoint.sh           up (healthy)   9999/tcp                                                               
clair               ./docker-entrypoint.sh           up (healthy)   6060/tcp, 6061/tcp                                                     
clair-adapter       /clair-adapter/clair-adapter     up (healthy)   8080/tcp                                                               
harbor-core         /harbor/harbor_core              up (healthy)                                                                          
harbor-db           /docker-entrypoint.sh            up (healthy)   5432/tcp                                                               
harbor-jobservice   /harbor/harbor_jobservice  ...   up (healthy)                                                                          
harbor-log          /bin/sh -c /usr/local/bin/ ...   up (healthy)   127.0.0.1:1514->10514/tcp                                              
harbor-portal       nginx -g daemon off;             up (healthy)   8080/tcp                                                               
nginx               nginx -g daemon off;             up (healthy)   0.0.0.0:4443->4443/tcp,:::4443->4443/tcp,                              
                                                                    0.0.0.0:80->8080/tcp,:::80->8080/tcp,                                  
                                                                    0.0.0.0:443->8443/tcp,:::443->8443/tcp                                 
notary-server       /bin/sh -c migrate-patch - ...   up                                                                                    
notary-signer       /bin/sh -c migrate-patch - ...   up                                                                                    
redis               redis-server /etc/redis.conf     up (healthy)   6379/tcp                                                               
registry            /home/harbor/entrypoint.sh       up (healthy)   5000/tcp                                                               
registryctl         /home/harbor/start.sh            up (healthy)

4443端口就是用来签名的

?
1
2
[root@server1 harbor]# export docker_content_trust=1
[root@server1 harbor]# export docker_content_trust_server=https://reg.westos.org:4443

(2)启用docker内容信任

?
1
2
3
4
5
6
7
8
[root@server1 harbor]# docker push reg.westos.org/library/nginx:latest
the push refers to repository [reg.westos.org/library/nginx]
3bd8699f28ba: layer already exists
1d3b68b6972f: layer already exists
de1602ca36c9: layer already exists
latest: digest: sha256:5ea5a786e978abd8e6e0b6c0f37f7271be19c40d6b8247b1d9dae70c1fbab9eb size: 949
signing and pushing trust metadata
error: error contacting notary server: x509: certificate signed by unknown authority

latest一定要加,这表明了版本的更新
(3)重新上传报错了,没有证书
在隐藏目录.docker中,创建证书目录tls,进入该目录后,创建和容器名称相同的目录reg.westos.org:4443。
复制之前生成好的证书到该目录中

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root@server1 ~]# cd .docker/
[root@server1 .docker]# ls
config.json  trust
[root@server1 .docker]# mkdir tls
[root@server1 .docker]# cd tls/
[root@server1 tls]# mkdir reg.westos.org:4443
[root@server1 tls]# cd reg.westos.org\:4443/
[root@server1 reg.westos.org:4443]# cp /docker /
.autorelabel  data/         etc/          lib64/        opt/          run/          sys/          var/         
bin/          dev/          home/         media/        proc/         sbin/         tmp/         
boot/         docker        lib/          mnt/          root/         srv/          usr/         
[root@server1 reg.westos.org:4443]# cp /root/data/certs/westos.org.crt ca.crt
[root@server1 reg.westos.org:4443]# ls
ca.crt

(4)重新上传试试

?
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
[root@server1 harbor]# docker push reg.westos.org/library/nginx:latest
the push refers to repository [reg.westos.org/library/nginx]
3bd8699f28ba: layer already exists
1d3b68b6972f: layer already exists
de1602ca36c9: layer already exists
latest: digest: sha256:5ea5a786e978abd8e6e0b6c0f37f7271be19c40d6b8247b1d9dae70c1fbab9eb size: 949
signing and pushing trust metadata
you are about to create a new root signing key passphrase. this passphrase
will be used to protect the most sensitive key in your signing system. please
choose a long, complex passphrase and be careful to keep the password and the
key file itself secure and backed up. it is highly recommended that you use a
password manager to generate the passphrase and keep it safe. there will be no
way to recover this key. you can find the key in your config directory.
enter passphrase for new root key with id dbac0cb:
passphrase is too short. please use a password manager to generate and store a good random passphrase.
enter passphrase for new root key with id dbac0cb:
passphrase is too short. please use a password manager to generate and store a good random passphrase.
enter passphrase for new root key with id dbac0cb:
passphrase is too short. please use a password manager to generate and store a good random passphrase.
enter passphrase for new root key with id dbac0cb:
passphrase is too short. please use a password manager to generate and store a good random passphrase.
enter passphrase for new root key with id dbac0cb:
repeat passphrase for new root key with id dbac0cb:
enter passphrase for new repository key with id a868e96:
repeat passphrase for new repository key with id a868e96:
finished initializing "reg.westos.org/library/nginx"
successfully signed reg.westos.org/library/nginx:latest

解决问题之后,服务端再去上传镜像,成功
上传新的镜像,需要管理员设置根key和仓库key
(注意,每次上传镜像的不同版本时,只需要输入对应的仓库key,不需要输入根key)
设定好之后,去web界面查看,发现上传的镜像的签名处显示成功

docker5 全功能harbor仓库搭建过程

已签名,一定要加latest

?
1
2
3
4
5
6
7
8
9
[root@server2 ~]# docker pull nginx
using default tag: latest
latest: pulling from library/nginx
cfb92865f5ba: pull complete
8dd350b5e0d5: pull complete
15157df2751c: pull complete
digest: sha256:5ea5a786e978abd8e6e0b6c0f37f7271be19c40d6b8247b1d9dae70c1fbab9eb
status: downloaded newer image for nginx:latest
docker.io/library/nginx:latest

在server2拉取已签名的镜像没有问题,如果未签名还开启了内容信任,就还是不行
再次试试可行性,把2048先从harbor删掉,然后server2也删除之前下载的2048镜像,重新拉取,报错

?
1
2
3
[root@server2 ~]# docker pull game2048
using default tag: latest
error response from daemon: pull access denied for game2048, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

然后server1重新push2048

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root@server1 harbor]# docker push reg.westos.org/library/game2048:latest
the push refers to repository [reg.westos.org/library/game2048]
88fca8ae768a: layer already exists
6d7504772167: layer already exists
192e9fad2abc: layer already exists
36e9226e74f8: layer already exists
011b303988d2: layer already exists
latest: digest: sha256:8a34fb9cb168c420604b6e5d32ca6d412cb0d533a826b313b190535c03fe9390 size: 1364
signing and pushing trust metadata
enter passphrase for root key with id dbac0cb:
enter passphrase for new repository key with id 18c8514:
repeat passphrase for new repository key with id 18c8514:
finished initializing "reg.westos.org/library/game2048"
successfully signed reg.westos.org/library/game2048:latest

docker5 全功能harbor仓库搭建过程

已经签名,此时server2再次pull

?
1
2
3
4
5
6
7
8
9
10
11
[root@server2 ~]# docker pull game2048
using default tag: latest
latest: pulling from library/game2048
534e72e7cedc: pull complete
f62e2f6dfeef: pull complete
fe7db6293242: pull complete
3f120f6a2bf8: pull complete
4ba4e6930ea5: pull complete
digest: sha256:8a34fb9cb168c420604b6e5d32ca6d412cb0d533a826b313b190535c03fe9390
status: downloaded newer image for game2048:latest
docker.io/library/game2048:latest

done

4.guest用户访问未公开仓库
(1)新建一个项目

docker5 全功能harbor仓库搭建过程

?
1
[root@server1 harbor]# export docker_content_trust=0

把内容信任关闭掉,不然会麻烦

?
1
[root@server1 harbor]# docker tag reg.westos.org/library/game2048:latest reg.westos.org/haoge/game2048:latest
?
1
[root@server1 harbor]# docker push reg.westos.org/haoge/game2048

给haoge这个新项目重新上传一个2048镜像

docker5 全功能harbor仓库搭建过程

?
1
2
[root@server2 ~]# docker pull  reg.westos.org/haoge/game2048:latest
error response from daemon: pull access denied for reg.westos.org/haoge/game2048, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

server2拉取haoge下的2048,报错了,需要login

docker5 全功能harbor仓库搭建过程

新建一个用户

docker5 全功能harbor仓库搭建过程

在haoge项目里把wqh这个用户给一个访客身份

?
1
2
3
4
5
6
7
8
[root@server2 ~]# docker login reg.westos.org
username: wqh
password:
warning! your password will be stored unencrypted in /root/.docker/config.json.
configure a credential helper to remove this warning. see
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
 
login succeeded

server2登录wqh
再次拉取

?
1
2
3
4
5
6
7
8
9
10
[root@server2 ~]# docker pull reg.westos.org/haoge/game2048:latest
latest: pulling from haoge/game2048
digest: sha256:8a34fb9cb168c420604b6e5d32ca6d412cb0d533a826b313b190535c03fe9390
status: downloaded newer image for reg.westos.org/haoge/game2048:latest
reg.westos.org/haoge/game2048:latest
[root@server2 ~]# docker images
repository                      tag       image id       created         size
nginx                           latest    2560dbd4ee1e   14 months ago   31.1mb
game2048                        latest    19299002fdbe   4 years ago     55.5mb
reg.westos.org/haoge/game2048   latest    19299002fdbe   4 years ago     55.5mb

没问题
但是push是不可以的,因为访客是没有权限的

docker5 全功能harbor仓库搭建过程

日志可以看到刚才wqh拉去了一个镜像
最后:
去掉镜像扫描和签名功能,这些加快磁盘的消耗
(扫描加快磁盘的消耗)
(之后的实验不需要镜像扫描和签名)

?
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
[root@server1 harbor]# docker-compose stop
stopping harbor-jobservice ... done
stopping nginx             ... done
stopping notary-server     ... done
stopping clair-adapter     ... done
stopping notary-signer     ... done
stopping clair             ... done
stopping harbor-core       ... done
stopping chartmuseum       ... done
stopping harbor-portal     ... done
stopping redis             ... done
stopping registryctl       ... done
stopping harbor-db         ... done
stopping registry          ... done
stopping harbor-log        ... done
[root@server1 harbor]# docker-compose rm
going to remove harbor-jobservice, nginx, notary-server, clair-adapter, notary-signer, clair, harbor-core, chartmuseum, harbor-portal, redis, registryctl, harbor-db, registry, harbor-log
are you sure? [yn] y
removing harbor-jobservice ... done
removing nginx             ... done
removing notary-server     ... done
removing clair-adapter     ... done
removing notary-signer     ... done
removing clair             ... done
removing harbor-core       ... done
removing chartmuseum       ... done
removing harbor-portal     ... done
removing redis             ... done
removing registryctl       ... done
removing harbor-db         ... done
removing registry          ... done
removing harbor-log        ... done
[root@server1 harbor]# ./install.sh --with-chartmuseum
 
[step 0]: checking if docker is installed ...
 
note: docker version: 19.03.15
 
[step 1]: checking docker-compose is installed ...
 
note: docker-compose version: 1.27.0
 
[step 2]: loading harbor images ...
loaded image: goharbor/clair-adapter-photon:v1.0.1-v1.10.1
loaded image: goharbor/harbor-jobservice:v1.10.1
loaded image: goharbor/redis-photon:v1.10.1
loaded image: goharbor/notary-server-photon:v0.6.1-v1.10.1
loaded image: goharbor/clair-photon:v2.1.1-v1.10.1
loaded image: goharbor/harbor-log:v1.10.1
loaded image: goharbor/registry-photon:v2.7.1-patch-2819-2553-v1.10.1
loaded image: goharbor/notary-signer-photon:v0.6.1-v1.10.1
loaded image: goharbor/chartmuseum-photon:v0.9.0-v1.10.1
loaded image: goharbor/harbor-registryctl:v1.10.1
loaded image: goharbor/nginx-photon:v1.10.1
loaded image: goharbor/harbor-migrator:v1.10.1
loaded image: goharbor/prepare:v1.10.1
loaded image: goharbor/harbor-portal:v1.10.1
loaded image: goharbor/harbor-core:v1.10.1
loaded image: goharbor/harbor-db:v1.10.1
 
 
[step 3]: preparing environment ...
 
[step 4]: preparing harbor configs ...
prepare base dir is set to /mnt/harbor
clearing the configuration file: /config/log/logrotate.conf
clearing the configuration file: /config/log/rsyslog_docker.conf
clearing the configuration file: /config/nginx/conf.d/notary.upstream.conf
clearing the configuration file: /config/nginx/conf.d/notary.server.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/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
clearing the configuration file: /config/notary/server-config.postgres.json
clearing the configuration file: /config/notary/server_env
clearing the configuration file: /config/notary/signer_env
clearing the configuration file: /config/notary/signer-config.postgres.json
clearing the configuration file: /config/notary/notary-signer.key
clearing the configuration file: /config/notary/notary-signer.crt
clearing the configuration file: /config/notary/notary-signer-ca.crt
clearing the configuration file: /config/notary/root.crt
clearing the configuration file: /config/clair/postgresql-init.d/readme.md
clearing the configuration file: /config/clair/postgres_env
clearing the configuration file: /config/clair/config.yaml
clearing the configuration file: /config/clair/clair_env
clearing the configuration file: /config/clair-adapter/env
clearing the configuration file: /config/chartserver/env
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/db/env
generated configuration file: /config/jobservice/env
generated configuration file: /config/jobservice/config.yml
loaded secret from file: /secret/keys/secretkey
generated configuration file: /config/chartserver/env
generated configuration file: /compose_location/docker-compose.yml
clean up the input dir
 
 
 
[step 5]: starting harbor ...
creating harbor-log ... done
creating harbor-portal ... done
creating registryctl   ... done
creating harbor-db     ... done
creating redis         ... done
creating registry      ... done
creating chartmuseum   ... done
creating harbor-core   ... done
creating nginx             ... done
creating harbor-jobservice ... done
✔ ----harbor has been installed and started successfully.----
[root@server1 harbor]# docker-compose ps
      name                     command                       state                                        ports                            
--------------------------------------------------------------------------------------------------------------------------------------------
chartmuseum         ./docker-entrypoint.sh           up (health: starting)   9999/tcp                                                      
harbor-core         /harbor/harbor_core              up (health: starting)                                                                 
harbor-db           /docker-entrypoint.sh            up (health: starting)   5432/tcp                                                      
harbor-jobservice   /harbor/harbor_jobservice  ...   up (health: starting)                                                                 
harbor-log          /bin/sh -c /usr/local/bin/ ...   up (health: starting)   127.0.0.1:1514->10514/tcp                                     
harbor-portal       nginx -g daemon off;             up (health: starting)   8080/tcp                                                      
nginx               nginx -g daemon off;             up (health: starting)   0.0.0.0:80->8080/tcp,:::80->8080/tcp,                         
                                                                             0.0.0.0:443->8443/tcp,:::443->8443/tcp                        
redis               redis-server /etc/redis.conf     up (health: starting)   6379/tcp                                                      
registry            /home/harbor/entrypoint.sh       up (health: starting)   5000/tcp                                                      
registryctl         /home/harbor/start.sh            up (health: starting)

docker5 全功能harbor仓库搭建过程

最终效果

以上就是docker5 全功能harbor的详细内容,更多关于docker harbor的资料请关注服务器之家其它相关文章!

原文链接:https://blog.csdn.net/AwesomeWang7/article/details/118028756

标签:

相关文章

热门资讯

yue是什么意思 网络流行语yue了是什么梗
yue是什么意思 网络流行语yue了是什么梗 2020-10-11
2020微信伤感网名听哭了 让对方看到心疼的伤感网名大全
2020微信伤感网名听哭了 让对方看到心疼的伤感网名大全 2019-12-26
背刺什么意思 网络词语背刺是什么梗
背刺什么意思 网络词语背刺是什么梗 2020-05-22
苹果12mini价格表官网报价 iPhone12mini全版本价格汇总
苹果12mini价格表官网报价 iPhone12mini全版本价格汇总 2020-11-13
2021德云社封箱演出完整版 2021年德云社封箱演出在线看
2021德云社封箱演出完整版 2021年德云社封箱演出在线看 2021-03-15
返回顶部