Docker学习笔记08-----Docker Harbor使用详解
Docker Harbor使用详解
1、项目
项目包含了一个应用的所有仓库,项目未被创建之前镜像不能推送到Harbor。只有被授权的用户才可以对该项目进行操作。
Harbor中有两种项目类型:
- 公开: 任何用户都可以从这个项目中拉取镜像
- 私有: 仅项目成员可以从这个项目中拉取镜像
1.1、新建项目
项目->新建项目
项目创建成功
1.2、指派用户
如果用户不存在,则先创建用户。点击“系统管理->用户管理->新建用户”
录入用户信息,点击“确定”,创建用户
用户创建成功
选择一个项目,选择成员页签,点击“用户”
输入用户,选择用户角色,点击“确定”
角色详细权限
https://goharbor.io/docs/1.10/administration/managing-users/user-permissions-by-role/
总体来说角色权限分为访客、开发者、管理者。
- 访客: 用于拉取镜像
- 开发者:用于拉取镜像用于拉取、推送镜像
- 管理者:用于管理平台。
1.3、修改角色或移除用户
选择用户,点击“其他操作”可以对该用户进行角色修改或从项目中移除该用户
1.4、配置管理
在配置管理页签中,可以对该项目访问级别、部署安全、漏洞扫描等进行配置
1.5、镜像仓库
在镜像仓库页签中,点击“推送命令”可以看到Docker推送命令
1.6、推送镜像
登录仓库
[root@localhost ~]# docker login www.xxx.com.cn: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-storeLogin Succeeded
标记本地仓库
[root@localhost ~]# docker tag 4a97d3158956 www.xxx.com.cn: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
www.xxx.com.cn:4443/itmrl_pub/helloworld 1.0.0 4a97d3158956 3 days ago 659MB
推送镜像
[root@localhost ~]# docker push www.xxx.com.cn:4443/itmrl_pub/helloworld:1.0.0
The push refers to repository [www.xxx.com.cn: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
1.7、拉取镜像
[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 www.yusys-sy.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 www.yusys-sy.com.cn:4443/itmrl_pub/helloworld:1.0.0
www.yusys-sy.com.cn:4443/itmrl_pub/helloworld:1.0.0
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
www.yusys-sy.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 www.xxx.com.cn: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 www.xxx.com.cn: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-storeLogin Succeeded
[root@localhost ~]# docker pull www.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 www.xxx.com.cn:4443/itmrl_pub/helloworld:1.0.0
www.xxx.com.cn:4443/itmrl_pub/helloworld:1.0.0
2、日志
日志功能可以查看操作的日志
3、系统管理
3.1、用户管理
维护系统用户
3.2、分布式分发
3.3、标签
创建标签,用于给镜像打标签
3.4、项目定额
项目定额功能可以设置项目默认的磁盘空间及每个项目的磁盘空间
3.5、垃圾回收
可以手工或定时执行垃圾回收
同时查看垃圾回收的记录和详细日志
回收记录
详细日志
3.6、配置管理
认证模式
默认认证模式为数据库认证,即用户认证凭证存储在本地数据库。如果使用LDAP来认证用户,则设置为LDAP。
允许自注册
开启自注册功能后可以在登录界面自己注册用户。
配置邮箱服务器
邮箱服务器用于给重置密码的用户发送邮件
按照官方介绍,当用户发起密码修改会发送邮件,但是目前测试并没有发送。在官方Issues中查找可以发现有相关的回复如下:
在v2.2版本中email配置可能会被移除,当前功能并没有使用。
项目创建
用户确定哪些用户有权限创建项目,默认为“所有人”。设置为“仅管理员”则只有管理员可以创建项目。
仓库只读
Harbor被设置为只读模式,在此模式下,不能删除仓库、artifact、 Tag 及推送镜像。
4、日志
日志根路径
/var/log/harbor
Docker学习笔记08-----Docker Harbor使用详解相关推荐
- Docker学习笔记2 -- Docker的基本命令和使用
目录 Docker学习笔记1 Docker帮助命令 Docker镜像命令 Docker容器命令 Docker commit操作 Docker学习笔记1 Docker学习笔记1 – Docker基本原理 ...
- JDBC学习笔记02【ResultSet类详解、JDBC登录案例练习、PreparedStatement类详解】
黑马程序员-JDBC文档(腾讯微云)JDBC笔记.pdf:https://share.weiyun.com/Kxy7LmRm JDBC学习笔记01[JDBC快速入门.JDBC各个类详解.JDBC之CR ...
- 小猫爪:i.MX RT1050学习笔记26-RT1xxx系列的FlexCAN详解
i.MX RT1050学习笔记26-RT1xxx系列的FlexCAN详解 1 前言 2 FlexCAN简介 2.1 MB(邮箱)系统 2.1.1 正常模式下 2.1.2 激活了CAN FD情况下 2. ...
- IP地址和子网划分学习笔记之《IP地址详解》
在学习IP地址和子网划分前,必须对进制计数有一定了解,尤其是二进制和十进制之间的相互转换,对于我们掌握IP地址和子网的划分非常有帮助,可参看如下目录详文. IP地址和子网划分学习笔记相关篇章: 1.I ...
- 我的学习笔记——CSS背景渐变(Gradients)详解
我的学习笔记--CSS背景渐变(Gradients)详解 一.线性渐变(Linear Gradients) 1.语法 background-image: linear-gradient(directi ...
- IP地址和子网划分学习笔记之《子网划分详解》
一,子网划分概述 IP地址和子网划分学习笔记相关篇章: 1.IP地址和子网划分学习笔记之<预备知识:进制计数> 2.IP地址和子网划分学习笔记之<IP地址详解> 3.IP地址和 ...
- Docker学习笔记 之 Docker安装配置使用
简介 Docker是一个开源的引擎,可以轻松的为任何应用创建一个轻量级的.可移植的.自给自足的容器.开发者在笔记本上编译测试通过的容器可以批量地在生产环境中部署,包括VMs(虚拟机).bare met ...
- docker学习笔记(五)docker实战
目录 一.搭建MySQL高可用集群(pxc+HA-Proxy) 二.Nginx+Spring Boot+MySQL 一.搭建MySQL高可用集群(pxc+HA-Proxy) 参考链接:https:// ...
- docker学习笔记(四)docker数据持久化volume
docker数据持久化 官网:https://docs.docker.com/storage/volumes/ docker中的容器是可以随时销毁的,容器中的数据会随着容器的消亡而消亡.然而很多容器都 ...
- docker学习笔记(一)docker入门
目录 基本概念 docker引擎 docker架构 安装docker docker常用命令 Docker 是一个开源的应用容器引擎,它基于 Go 语言 并遵从 Apache2.0 协议开源. Dock ...
最新文章
- SAP RETAIL系统与制造业SAP系统上关于补货的配置
- linux(Ubuntu/Centos) iproute 路由IP地址等命令集合,查看端口链接
- Python学习笔记一简介及安装配置
- SQLServer之创建分布式事务
- xshell与xftp使用注意
- 前端读者 | 别人写的css,你敢用吗?
- Python 求最大子集的递归实现
- promise间隔时间添加dom
- 阐述Linux动态库的显式调用
- China Daily | 技术不是拦路虎:在线音乐教学可完美还原线下场景
- Linux Linux内核参数调优
- 电气工程学python_浅谈如何学习电气工程及其自动化专业
- MySQL计算同比和环比
- 本质与现象:本质与现象
- python文件打包为deb_DEB包详解
- vue根据文件名后缀区分
- 在Openwrt 上使用迅雷远程下载功能
- 火遍全网的 ChatGPT,给你的求职新方向
- 还在问视频音频转文字软件哪个好吗?快码住这两款
- 解决关于VS2019输入会顶掉后面字符的问题