日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

Docker学习笔记08-----Docker Harbor使用详解

發(fā)布時(shí)間:2023/12/31 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Docker学习笔记08-----Docker Harbor使用详解 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

Docker Harbor使用詳解

1、項(xiàng)目

項(xiàng)目包含了一個(gè)應(yīng)用的所有倉(cāng)庫(kù),項(xiàng)目未被創(chuàng)建之前鏡像不能推送到Harbor。只有被授權(quán)的用戶(hù)才可以對(duì)該項(xiàng)目進(jìn)行操作。

Harbor中有兩種項(xiàng)目類(lèi)型:

  • 公開(kāi): 任何用戶(hù)都可以從這個(gè)項(xiàng)目中拉取鏡像
  • 私有: 僅項(xiàng)目成員可以從這個(gè)項(xiàng)目中拉取鏡像
1.1、新建項(xiàng)目
項(xiàng)目->新建項(xiàng)目

項(xiàng)目創(chuàng)建成功

1.2、指派用戶(hù)

如果用戶(hù)不存在,則先創(chuàng)建用戶(hù)。點(diǎn)擊“系統(tǒng)管理->用戶(hù)管理->新建用戶(hù)”

錄入用戶(hù)信息,點(diǎn)擊“確定”,創(chuàng)建用戶(hù)

用戶(hù)創(chuàng)建成功

選擇一個(gè)項(xiàng)目,選擇成員頁(yè)簽,點(diǎn)擊“用戶(hù)”

輸入用戶(hù),選擇用戶(hù)角色,點(diǎn)擊“確定”

角色詳細(xì)權(quán)限

https://goharbor.io/docs/1.10/administration/managing-users/user-permissions-by-role/

總體來(lái)說(shuō)角色權(quán)限分為訪客、開(kāi)發(fā)者、管理者。

  • 訪客: 用于拉取鏡像
  • 開(kāi)發(fā)者:用于拉取鏡像用于拉取、推送鏡像
  • 管理者:用于管理平臺(tái)。
1.3、修改角色或移除用戶(hù)

選擇用戶(hù),點(diǎn)擊“其他操作”可以對(duì)該用戶(hù)進(jìn)行角色修改或從項(xiàng)目中移除該用戶(hù)

1.4、配置管理

在配置管理頁(yè)簽中,可以對(duì)該項(xiàng)目訪問(wèn)級(jí)別、部署安全、漏洞掃描等進(jìn)行配置

1.5、鏡像倉(cāng)庫(kù)

在鏡像倉(cāng)庫(kù)頁(yè)簽中,點(diǎn)擊“推送命令”可以看到Docker推送命令

1.6、推送鏡像
登錄倉(cāng)庫(kù)
[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
標(biāo)記本地倉(cāng)庫(kù)
[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
修改項(xiàng)目訪問(wèn)權(quán)限為私有,再次拉取
[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、系統(tǒng)管理

3.1、用戶(hù)管理

維護(hù)系統(tǒng)用戶(hù)

3.2、分布式分發(fā)
3.3、標(biāo)簽

創(chuàng)建標(biāo)簽,用于給鏡像打標(biāo)簽

3.4、項(xiàng)目定額

項(xiàng)目定額功能可以設(shè)置項(xiàng)目默認(rèn)的磁盤(pán)空間及每個(gè)項(xiàng)目的磁盤(pán)空間

3.5、垃圾回收

可以手工或定時(shí)執(zhí)行垃圾回收

同時(shí)查看垃圾回收的記錄和詳細(xì)日志

回收記錄

詳細(xì)日志

3.6、配置管理

認(rèn)證模式

默認(rèn)認(rèn)證模式為數(shù)據(jù)庫(kù)認(rèn)證,即用戶(hù)認(rèn)證憑證存儲(chǔ)在本地?cái)?shù)據(jù)庫(kù)。如果使用LDAP來(lái)認(rèn)證用戶(hù),則設(shè)置為L(zhǎng)DAP。

允許自注冊(cè)

開(kāi)啟自注冊(cè)功能后可以在登錄界面自己注冊(cè)用戶(hù)。

配置郵箱服務(wù)器

郵箱服務(wù)器用于給重置密碼的用戶(hù)發(fā)送郵件

按照官方介紹,當(dāng)用戶(hù)發(fā)起密碼修改會(huì)發(fā)送郵件,但是目前測(cè)試并沒(méi)有發(fā)送。在官方Issues中查找可以發(fā)現(xiàn)有相關(guān)的回復(fù)如下:


在v2.2版本中email配置可能會(huì)被移除,當(dāng)前功能并沒(méi)有使用。

項(xiàng)目創(chuàng)建

用戶(hù)確定哪些用戶(hù)有權(quán)限創(chuàng)建項(xiàng)目,默認(rèn)為“所有人”。設(shè)置為“僅管理員”則只有管理員可以創(chuàng)建項(xiàng)目。

倉(cāng)庫(kù)只讀

Harbor被設(shè)置為只讀模式,在此模式下,不能刪除倉(cāng)庫(kù)、artifact、 Tag 及推送鏡像。

4、日志

日志根路徑

/var/log/harbor

總結(jié)

以上是生活随笔為你收集整理的Docker学习笔记08-----Docker Harbor使用详解的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。