Docker学习笔记08-----DockerHarbor使⽤详解
Docker Harbor使⽤详解
1、项⽬
项⽬包含了⼀个应⽤的所有仓库,项⽬未被创建之前镜像不能推送到Harbor。只有被授权的⽤户才可以对该项⽬进⾏操作。Harbor中有两种项⽬类型:
公开: 任何⽤户都可以从这个项⽬中拉取镜像
私有: 仅项⽬成员可以从这个项⽬中拉取镜像
1.1、新建项⽬
项⽬->新建项⽬
项⽬创建成功
酱爆海螺
1.2、指派⽤户
如果⽤户不存在,则先创建⽤户。点击“系统管理->⽤户管理->新建⽤户”
录⼊⽤户信息,点击“确定”,创建⽤户
⽤户创建成功
选择⼀个项⽬,选择成员页签,点击“⽤户”
输⼊⽤户,选择⽤户⾓⾊,点击“确定”
⾓⾊详细权限
总体来说⾓⾊权限分为访客、开发者、管理者。
访客: ⽤于拉取镜像
开发者:⽤于拉取镜像⽤于拉取、推送镜像
管理者:⽤于管理平台。
1.3、修改⾓⾊或移除⽤户
选择⽤户,点击“其他操作”可以对该⽤户进⾏⾓⾊修改或从项⽬中移除该⽤户
1.4、配置管理
在配置管理页签中,可以对该项⽬访问级别、部署安全、漏洞扫描等进⾏配置
1.5、镜像仓库
在镜像仓库页签中,点击“推送命令”可以看到Docker推送命令
1.6、推送镜像
登录仓库
[root@localhost ~]# docker m:4443
Urname: dev_ur
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.cloup
Configure a credential helper to remove this warning. See
/engine/reference/commandline/login/#credentials-store
Login Succeeded
科学玩具标记本地仓库
[root@localhost ~]# docker tag m: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
[root@localhost ~]# docker m:4443/itmrl_pub/helloworld:1.0.0
先天性脑瘫
The push refers to repository [: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 :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 :4443/itmrl_pub/helloworld:1.0.0
:4443/itmrl_pub/helloworld:1.0.0
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
: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 m:4443/itmrl_pub/helloworld:1.0.0
Error respon from daemon: unauthorized: unauthorized to access repository: itmrl_pub/helloworld, action: pull: unauthorized to access repository: itmrl_ pub/helloworld, action: pull
登录后再次拉取