赞
踩
项目包含了一个应用的所有仓库,项目未被创建之前镜像不能推送到Harbor。只有被授权的用户才可以对该项目进行操作。
Harbor中有两种项目类型:
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-qvHtp8Kg-1614673980642)(404389716D7142F5BC3B78317C39FA3A)]](https://img-blog.csdnimg.cn/20210302163037866.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xoeTAzMDMyMDk5OQ==,size_16,color_FFFFFF,t_70)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-1Rh4synF-1614673980644)(75C80B5C4AF64FEF8125FF1C7B8ED71E)]](https://img-blog.csdnimg.cn/20210302163047304.png)
如果用户不存在,则先创建用户。点击“系统管理->用户管理->新建用户”
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Gk5u53NF-1614673980645)(7979A440ED1542969830B3E101772F0D)]](https://img-blog.csdnimg.cn/20210302163058241.png)
录入用户信息,点击“确定”,创建用户
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-XQd6G1ns-1614673980647)(1D951CC9055E49BDAE7E7E9A39D6917D)]](https://img-blog.csdnimg.cn/20210302163119996.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xoeTAzMDMyMDk5OQ==,size_16,color_FFFFFF,t_70)
用户创建成功
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-wivvT1zW-1614673980648)(31C3590221144E7B9FFB81823F3D9969)]](https://img-blog.csdnimg.cn/20210302163136769.png)
选择一个项目,选择成员页签,点击“用户”

输入用户,选择用户角色,点击“确定”
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-JgeISAPl-1614673980650)(4FF028A9C44641CE824506D07B259B65)]](https://img-blog.csdnimg.cn/2021030216321174.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xoeTAzMDMyMDk5OQ==,size_16,color_FFFFFF,t_70)
角色详细权限
https://goharbor.io/docs/1.10/administration/managing-users/user-permissions-by-role/
总体来说角色权限分为访客、开发者、管理者。
选择用户,点击“其他操作”可以对该用户进行角色修改或从项目中移除该用户
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-1HipgkmZ-1614673980651)(E91F6207A8B9459DA4CC320B4FEA940E)]](https://img-blog.csdnimg.cn/20210302163224635.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xoeTAzMDMyMDk5OQ==,size_16,color_FFFFFF,t_70)
在配置管理页签中,可以对该项目访问级别、部署安全、漏洞扫描等进行配置
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-hbTk9xng-1614673980652)(143B32882DBC4CF68E7F346EEFD275FF)]](https://img-blog.csdnimg.cn/20210302163236995.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xoeTAzMDMyMDk5OQ==,size_16,color_FFFFFF,t_70)
在镜像仓库页签中,点击“推送命令”可以看到Docker推送命令
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-AA2C5HpN-1614673980653)(8883FF30E3604537A7CD34CD4371426F)]](https://img-blog.csdnimg.cn/20210302163247677.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xoeTAzMDMyMDk5OQ==,size_16,color_FFFFFF,t_70)
[root@localhost ~]# docker login 127.0.0.1:4443
Username: dev_user
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
[root@localhost ~]# docker tag 4a97d3158956 127.0.0.1:4443/itmrl_pub/helloworld:1.0.0
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
helloworld 1.0.0 4a97d3158956 3 days ago 659MB
127.0.0.1:4443/itmrl_pub/helloworld 1.0.0 4a97d3158956 3 days ago 659MB
[root@localhost ~]# docker push 127.0.0.1:4443/itmrl_pub/helloworld:1.0.0
The push refers to repository [127.0.0.1:4443/itmrl_pub/helloworld]
7ecd0eab9c73: Pushed
35c20f26d188: Pushed
c3fe59dd9556: Pushed
6ed1a81ba5b6: Pushed
a3483ce177ce: Pushed
ce6c8756685b: Pushed
30339f20ced0: Pushed
0eb22bfb707d: Pushed
a2ae92ffcd29: Pushed
1.0.0: digest: sha256:74ed6579c9e1e874fe73da2a50e1b0e15dc78a67de533aa0c39facf3bfbba296 size: 2212
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-qyPFDQrc-1614673980653)(A55A65CF1CB04E898D10B4F38E1515FD)]](https://img-blog.csdnimg.cn/20210302163306756.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xoeTAzMDMyMDk5OQ==,size_16,color_FFFFFF,t_70)
[root@localhost ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE mysql 5.7 a70d36bc331a 6 weeks ago 449MB mysql latest c8562eaf9d81 6 weeks ago 546MB tomcat latest 040bdb29ab37 6 weeks ago 649MB tomcat 8.5.32 5808f01b11bf 2 years ago 463MB java 8 d23bdf5b1b1b 4 years ago 643MB [root@localhost ~]# docker pull xxx.com.cn:4443/itmrl_pub/helloworld:1.0.0 1.0.0: Pulling from itmrl_pub/helloworld 7448db3b31eb: Already exists c36604fa7939: Already exists 29e8ef0e3340: Already exists a0c934d2565d: Already exists a360a17c9cab: Already exists cfcc996af805: Already exists 2cf014724202: Already exists 4bc402a00dfe: Already exists 353d55df259a: Pull complete Digest: sha256:74ed6579c9e1e874fe73da2a50e1b0e15dc78a67de533aa0c39facf3bfbba296 Status: Downloaded newer image for xxx.com.cn:4443/itmrl_pub/helloworld:1.0.0 xxx.com.cn:4443/itmrl_pub/helloworld:1.0.0 [root@localhost ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE xxx.com.cn:4443/itmrl_pub/helloworld 1.0.0 4a97d3158956 3 days ago 659MB mysql 5.7 a70d36bc331a 6 weeks ago 449MB mysql latest c8562eaf9d81 6 weeks ago 546MB tomcat latest 040bdb29ab37 6 weeks ago 649MB tomcat 8.5.32 5808f01b11bf 2 years ago 463MB java 8 d23bdf5b1b1b 4 years ago 643MB
[root@localhost ~]# docker pull 127.0.0.1:4443/itmrl_pub/helloworld:1.0.0
Error response from daemon: unauthorized: unauthorized to access repository: itmrl_pub/helloworld, action: pull: unauthorized to access repository: itmrl_pub/helloworld, action: pull
[root@localhost ~]# docker login 127.0.0.1:4443 Username: dev_user 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 [root@localhost ~]# docker pull 127.0.0.1:4443/itmrl_pub/helloworld:1.0.0 1.0.0: Pulling from itmrl_pub/helloworld 7448db3b31eb: Already exists c36604fa7939: Already exists 29e8ef0e3340: Already exists a0c934d2565d: Already exists a360a17c9cab: Already exists cfcc996af805: Already exists 2cf014724202: Already exists 4bc402a00dfe: Already exists 353d55df259a: Pull complete Digest: sha256:74ed6579c9e1e874fe73da2a50e1b0e15dc78a67de533aa0c39facf3bfbba296 Status: Downloaded newer image for 127.0.0.1:4443/itmrl_pub/helloworld:1.0.0 127.0.0.1:4443/itmrl_pub/helloworld:1.0.0
日志功能可以查看操作的日志
维护系统用户
创建标签,用于给镜像打标签
项目定额功能可以设置项目默认的磁盘空间及每个项目的磁盘空间
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-HOHE7qjg-1614673980654)(C1A6BDA9359749D883816E9CFDDD8126)]](https://img-blog.csdnimg.cn/20210302163321888.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xoeTAzMDMyMDk5OQ==,size_16,color_FFFFFF,t_70)
可以手工或定时执行垃圾回收
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-eRMf2R5g-1614673980655)(DFD0A46389484CFA9CCFD4CC6C1CDBE6)]](https://img-blog.csdnimg.cn/20210302163334126.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xoeTAzMDMyMDk5OQ==,size_16,color_FFFFFF,t_70)
同时查看垃圾回收的记录和详细日志
回收记录
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-WAFml4Sa-1614673980656)(0A4F56A81D874C11ABB0962BD43AF75F)]](https://img-blog.csdnimg.cn/20210302163347700.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xoeTAzMDMyMDk5OQ==,size_16,color_FFFFFF,t_70)
详细日志
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Z03JyMcK-1614673980657)(7A50AB2CB25A4E43AE0A3C3CB41CF7F1)]](https://img-blog.csdnimg.cn/2021030216340158.png)
认证模式
默认认证模式为数据库认证,即用户认证凭证存储在本地数据库。如果使用LDAP来认证用户,则设置为LDAP。
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-MqAG8Mma-1614673980657)(CFA915857A914BF4AEDC60E4A0C36BC8)]](https://img-blog.csdnimg.cn/20210302163417515.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xoeTAzMDMyMDk5OQ==,size_16,color_FFFFFF,t_70)
允许自注册
开启自注册功能后可以在登录界面自己注册用户。
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ttYHNega-1614673980658)(0699C82844F64EDDBB65FBC213D3717D)]](https://img-blog.csdnimg.cn/20210302163429620.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xoeTAzMDMyMDk5OQ==,size_16,color_FFFFFF,t_70)
配置邮箱服务器
邮箱服务器用于给重置密码的用户发送邮件
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-6TKIhOVE-1614673980659)(3296077C395B46CBB90E6799EBD53583)]](https://img-blog.csdnimg.cn/20210302163442102.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xoeTAzMDMyMDk5OQ==,size_16,color_FFFFFF,t_70)
按照官方介绍,当用户发起密码修改会发送邮件,但是目前测试并没有发送。在官方Issues中查找可以发现有相关的回复如下:

在v2.2版本中email配置可能会被移除,当前功能并没有使用。
项目创建
用户确定哪些用户有权限创建项目,默认为“所有人”。设置为“仅管理员”则只有管理员可以创建项目。
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-W4gKJNvy-1614673980660)(D323DD1956FF4D8F82FA6CAC1D183341)]](https://img-blog.csdnimg.cn/20210302163453621.png)
仓库只读
Harbor被设置为只读模式,在此模式下,不能删除仓库、artifact、 Tag 及推送镜像。
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-IIaN7qrZ-1614673980660)(40E4BFA6EB024924962806B271E02823)]](https://img-blog.csdnimg.cn/20210302163503248.png)
日志根路径
/var/log/harbor
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。