docker使用harbor进行镜像仓库管理演示以及部分报错解决_harbor-registry-notary-server 报错-程序员宅基地

技术标签: Docker  容器  运维  harbor  docker-compose  docker  

目录

一.安装harbor和docker-compose

1.下载

2.将该文件修改为这样,修改好自己的hostname和port,后文的用户和密码可以不改也可以改,用于登录

3.安装

二.修改daemon.json文件和/etc/hosts文件

三.使用powershell作windows端域名映射

四.浏览器使用域名登录验证

1.用户admin,密码没有修改默认是Harbor12345

2.根据提供的推送指令操作

五.镜像打标签和推送

六.拉取验证

七.过程中遇到的一些问题

1.Get "https://harborslb.com/v2/": http: server gave HTTP response to HTTPS client

2.unauthorized: unauthorized to access repository: library/centos, action: push: unauthorized to access repository: library/centos, action: push

3.在浏览器使用账号密码登录时报错核心服务不可用

4.启动docker报docker.service holdoff time over, scheduling restart


 

一.安装harbor和docker-compose

1.下载

链接:https://pan.baidu.com/s/1FfDCJPWGcBK0krmiMfdpJQ 
提取码:8pu7

[root@localhost ~]# cd /usr/local/
[root@localhost local]# ll
total 651916
drwxr-xr-x. 2 root root         6 Apr 11  2018 bin
-rw-r--r--  1 root root  59383631 Aug 20 15:59 docker-compose-linux-x86_64
drwxr-xr-x. 2 root root         6 Apr 11  2018 etc
drwxr-xr-x. 2 root root         6 Apr 11  2018 games
-rw-r--r--  1 root root 608175520 Aug 20 16:01 harbor-offline-installer-v2.8.4.tgz
drwxr-xr-x. 2 root root         6 Apr 11  2018 include
drwxr-xr-x. 2 root root         6 Apr 11  2018 lib
drwxr-xr-x. 2 root root         6 Apr 11  2018 lib64
drwxr-xr-x. 2 root root         6 Apr 11  2018 libexec
drwxr-xr-x. 2 root root         6 Apr 11  2018 sbin
drwxr-xr-x. 5 root root        49 Jul 23 08:59 share
drwxr-xr-x. 2 root root         6 Apr 11  2018 src
[root@localhost local]# mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
[root@localhost local]# chmod +x /usr/local/bin/docker-compose

[root@localhost local]# tar -zxvf harbor-offline-installer-v2.8.4.tgz 
harbor/harbor.v2.8.4.tar.gz
harbor/prepare
harbor/LICENSE
harbor/install.sh
harbor/common.sh
harbor/harbor.yml.tmpl
[root@localhost local]# cd harbor/
[root@localhost harbor]# ll
total 597536
-rw-r--r-- 1 root root      3639 Aug 15 17:53 common.sh
-rw-r--r-- 1 root root 611834153 Aug 15 17:54 harbor.v2.8.4.tar.gz
-rw-r--r-- 1 root root     12499 Aug 15 17:53 harbor.yml.tmpl
-rwxr-xr-x 1 root root      2725 Aug 15 17:53 install.sh
-rw-r--r-- 1 root root     11347 Aug 15 17:53 LICENSE
-rwxr-xr-x 1 root root      1881 Aug 15 17:53 prepare
[root@localhost harbor]# cp harbor.yml.tmpl harbor.yml
[root@localhost harbor]# hostnamectl set-hostname harborslb.com

[root@localhost harbor]# vim harbor.yml

2.将该文件修改为这样,修改好自己的hostname和port,后文的用户和密码可以不改也可以改,用于登录

845afbda611d4cc4aee59201e73a6279.png

3.安装

[root@localhost harbor]# ./install.sh

二.修改daemon.json文件和/etc/hosts文件

[root@localhost harbor]# vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"],
"insecure-registries": ["192.168.2.190"],
"insecure-registries": ["harborslb.com"]
}
[root@localhost harbor]# tail -1 /etc/hosts  #按自己的实际名称修改
192.168.2.190 harborslb.com

[root@localhost harbor]# systemctl restart docker


[root@localhost harbor]#  docker-compose up -d
[+] Running 10/10
  Network harbor_harbor        Created                                                                                                                 0.0s 
  Container harbor-log         Started                                                                                                                 0.0s 
  Container harbor-portal      Started                                                                                                                 0.0s 
  Container registryctl        Started                                                                                                                 0.0s 
  Container registry           Started                                                                                                                 0.0s 
  Container redis              Started                                                                                                                 0.0s 
  Container harbor-db          Started                                                                                                                 0.0s 
  Container harbor-core        Started                                                                                                                 0.0s 
  Container harbor-jobservice  Started                                                                                                                 0.0s 
  Container nginx              Started      

三.使用powershell作windows端域名映射

Windows PowerShell
版权所有(C) Microsoft Corporation。保留所有权利。

安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows

PS C:\WINDOWS\system32> cd .\drivers\etc\
PS C:\WINDOWS\system32\drivers\etc> notepad .\hosts

4981937da26343c8993d0a3e5ea675f2.png

四.浏览器使用域名登录验证

1.用户admin,密码没有修改默认是Harbor12345

f0fc302940414ce2a060fe7fb644887e.png8674b014bf38468c8c950fd4afe52d16.png

2.根据提供的推送指令操作

d04c73b120974d818e98ad12f6ac9f09.png

五.镜像打标签和推送

[root@localhost harbor]# docker login http://harborslb.com  #使用刚才的用户和密码登录
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

[root@localhost harbor]# docker tag centos:latest harborslb.com/library/centos  #打标签

[root@localhost harbor]# docker push harborslb.com/library/centos  #推送到仓库
Using default tag: latest
The push refers to repository [harborslb.com/library/centos]
74ddd0ec08fa: Pushed 
latest: digest: sha256:a1801b843b1bfaf77c501e7a6d3f709401a1e0c83863037fa3aab063a7fdb9dc size: 529

ce61669061a846418660cf5431ad971f.png  

六.拉取验证

[root@localhost harbor]# docker pull harborslb.com/library/centos
Using default tag: latest
latest: Pulling from library/centos
Digest: sha256:a1801b843b1bfaf77c501e7a6d3f709401a1e0c83863037fa3aab063a7fdb9dc
Status: Image is up to date for harborslb.com/library/centos:latest
harborslb.com/library/centos:latest
[root@localhost harbor]# docker images
REPOSITORY                      TAG       IMAGE ID       CREATED         SIZE
nginx                           latest    eea7b3dcba7e   9 days ago      187MB
goharbor/harbor-exporter        v2.8.4    b8d33e28ec68   10 days ago     97.7MB
goharbor/redis-photon           v2.8.4    7b7324d651ca   10 days ago     120MB
goharbor/trivy-adapter-photon   v2.8.4    91d8e9f0b21a   10 days ago     464MB
goharbor/notary-server-photon   v2.8.4    a46f91560454   10 days ago     113MB
goharbor/notary-signer-photon   v2.8.4    da66bd8d944b   10 days ago     110MB
goharbor/harbor-registryctl     v2.8.4    805b38ca6bee   10 days ago     141MB
goharbor/registry-photon        v2.8.4    756769e94123   10 days ago     79MB
goharbor/nginx-photon           v2.8.4    375018db778b   10 days ago     116MB
goharbor/harbor-log             v2.8.4    8a2045fb24d2   10 days ago     124MB
goharbor/harbor-jobservice      v2.8.4    97808fc10f64   10 days ago     141MB
goharbor/harbor-core            v2.8.4    c26fcd0714d8   10 days ago     164MB
goharbor/harbor-portal          v2.8.4    4a8b0205c0f9   10 days ago     124MB
goharbor/harbor-db              v2.8.4    5b8af16d7420   10 days ago     174MB
goharbor/prepare                v2.8.4    bdbf974d86ce   10 days ago     166MB
mysql                           5.6       dd3b2a5dcb48   20 months ago   303MB
centos                          latest    5d0da3dc9764   23 months ago   231MB
harborslb.com/library/centos    latest    5d0da3dc9764   23 months ago   231MB
registry                        2.6.2     10b45af23ff3   3 years ago     28.5MB
owncloud                        latest    327bd201c5fb   4 years ago     618MB

七.过程中遇到的一些问题

1.Get "https://harborslb.com/v2/": http: server gave HTTP response to HTTPS client

检查/etc/docker/daemon.json文件的格式和参数是否正确,尤其是换行后添加“,”容易遗忘就导致安全仓库失败

{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"],
"insecure-registries": ["192.168.2.190"],
"insecure-registries": ["harborslb.com"]
}

2.unauthorized: unauthorized to access repository: library/centos, action: push: unauthorized to access repository: library/centos, action: push

可能是没有登录导致的,我登录了就解决了

[root@localhost harbor]# docker login http://harborslb.com  #使用刚才的用户和密码登录
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

3.在浏览器使用账号密码登录时报错核心服务不可用

我是运行此命令解决

[root@localhost harbor]#  docker-compose up -d

4.启动docker报docker.service holdoff time over, scheduling restart

和第一个问题同样,检查那个文件格式参数

 

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_64334766/article/details/132503473

智能推荐

grafana配置钉钉告警模版(一)_grafana 钉钉告警模板-程序员宅基地

文章浏览阅读1.4k次,点赞11次,收藏11次。grafana配置钉钉告警模版_grafana 钉钉告警模板

手机术语详解_k在电话号码的中文怎么说-程序员宅基地

文章浏览阅读1.5k次。1.3G 3G是Third Generation的简称,是指第三代移动通信。第一代移动通信是模拟无线网络,第二代是目前广为使用的GSM和CDMA。3G将具有更宽的带宽,其传输速度最低为384K,最高为2M,不仅能传输话音,还能传输数据,从而提供快捷、方便的无线应用,如无线接入Internet。 3G还处于试验阶段,预计2002年才能全面投入运营。从第二代移动通信向3G的过渡技术是GPRS。 2.GSM 春秋中文社区http://bbs.cqzg.cn_k在电话号码的中文怎么说

不高兴的津津(YZOJ-1052)_不高兴的津津 c语言-程序员宅基地

文章浏览阅读223次,点赞3次,收藏2次。【问题描述】津津上初中了。妈妈认为津津应该更加用功学习,所以津津除了上学之外,还要参加妈妈为她报名的各科复习班。另外每周妈妈还会送她去学习朗诵、舞蹈和钢琴。但是津津如果一天上课超过八个小时就会不高兴,而且上得越久就会越不高兴。假设津津不会因为其它事不高兴,并且她的不高兴不会持续到第二天。请你帮忙检查一下津津下周的日程安排,看看下周她会不会不高兴;如果会的话,哪天最不高兴。【输入格式】输入包括 777 行数据,分别表示周一到周日的日程安排。每行包括两个小于 101010 的非负整数,用空格隔开,分别表示_不高兴的津津 c语言

matplotlib中绘图常用函数_matplotlib函数-程序员宅基地

文章浏览阅读1.8w次,点赞23次,收藏158次。matplotlib中常用函数散点图 柱状图 等高线 matplotlib绘制3D图 子图像 动态图 常见设置 一、设置坐标轴 # x轴和y轴的值域plt.xlim((-1,2))plt.ylim((-2,3))# color为线的颜色,linewidth为线宽度,linestyle为样式(-为实线,--为虚线)plt.plot(x,y,color='red',..._matplotlib函数

linux退出pdf阅读,Ubuntu/Linux 下pdf阅读器Zathura(类vim操作)-程序员宅基地

文章浏览阅读261次。框架 Onboard-引导页样式制作库设置背景图片或者背景movie,然后在它们之上生成数个ViewController,默认是顶部一张图片,下面是标题和详细介绍,最下面是按钮和pagegithub地址https://github.c ...jquery的工具方法isFunction/isArray/isWindow/isNumeric&..._zathura 图形

【个人用】-Vscode安装的插件_vscode日历插件-程序员宅基地

文章浏览阅读337次。自己用的Vscode插件_vscode日历插件

随便推点

使用pandas的read_excel报错:ImportError: Missing optional dependency ‘xlrd‘. Install xlrd >= 1.0.0 for Exc_pandas读取xlsxmissing optional dependency 'xlrd'. in-程序员宅基地

文章浏览阅读2.5k次。问题:import pandas as pddf = pd.read_excel('需求.xlsx')df.head()报错:ImportError: Missing optional dependency 'xlrd'. Install xlrd >= 1.0.0 for Excel support Use pip or conda to install xlrd.解决方法:安装xlrd_pandas读取xlsxmissing optional dependency 'xlrd'. install xlrd >= 1.0.0 for

python安装lap_Python无法安装Box2Dswig.exe文件失败,错误代码为1-程序员宅基地

文章浏览阅读733次。我试图在python上安装Box2D,但得到错误日志:C:\>pip3 install Box2DCollecting Box2DUsing cached https://files.pythonhosted.org/packages/cc/7b/ddb96fea1fa5b24f8929714ef483f64c33e9649e7aae066e5f5023ea426a/Box2D-2.3.2...._python lap安装失败

找工作笔试面试那些事儿(17)---linux测试题_user.txt 存储用户列表 tab.txt存储表名和用户模版 根据这两个文件,将对应用户和-程序员宅基地

文章浏览阅读1.5w次,点赞2次,收藏40次。作者:寒小阳时间:2013年9月。出处:http://blog.csdn.net/han_xiaoyang/article/details/11400719。声明:版权所有,转载请注明出处,谢谢。 在对linux基本知识的归纳总结之后,这里是一份linux的测试题。希望能帮助大家复习和熟悉linux知识。一、选择题1.cron 后台常驻程序 (daemon) 用_user.txt 存储用户列表 tab.txt存储表名和用户模版 根据这两个文件,将对应用户和

iOS开发之苹果应用6.1日起需兼容IPv6,那么作为开发者我们需要做些什么呢?【科普IPV6】_软件支持ipv6要做哪些工作-程序员宅基地

文章浏览阅读7k次。我相信现在很多的iOS开发者都知道苹果要求我们提交到App Store的应用必须支持IPv6。 1.提到IPV6相关。 那这个直接就联想到就是关于我们App中网络部的一些内容,是否要进行相应的改变。 首先,解释下什么是ipv6? IPv6是下一代互联网的协议,它的提出最初是因为随着互联网的迅速发展,IPv4定义的有限地址空_软件支持ipv6要做哪些工作

/usr/local/lib/python3.6/dist-packages/bs4/__init__.py:220: UserWarning: You provided Unicode markup_userwarning: you provided unicode markup but also -程序员宅基地

文章浏览阅读3.4k次。/usr/local/lib/python3.6/dist-packages/bs4/init.py:220: UserWarning: You provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.warnings.warn(“You provided Unicode markup but also provided a value for from__userwarning: you provided unicode markup but also provided a value for from_

清华申请退学博士作品:完全用Linux工作_windows linux 清华退学-程序员宅基地

文章浏览阅读2.9k次。按: 尽管我们已经不习惯看长篇大论, 但我还是要说, 这是一篇值得你从头读到尾的长篇文章.2005年9月22日,清华在读博士生王垠在水木社区BLOG上发表了《清华梦的粉碎--写给清华大学的退学申请》明确要求退学, 引起社会各界广泛争论. 他创作的长篇文章《完全用Linux工作》, 洋洋两万多字, 从不同角度居高临下的阐述了他眼中Linux完全优越于Windows的各种理由, 这篇文章并不简单的是一_windows linux 清华退学