热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

docker仓库harbor搭建

1、安装docker-compose1[root@docker02~]#yuminstallepel-release2[root@docker02~]#pipinstal

1、安装docker-compose

1 [root@docker02 ~]# yum install epel-release
2 [root@docker02 ~]# pip install docker-compose

2、安装harbor

harbor下载地址

https://github.com/vmware/harbor/releases

 1     [root@docker02 ~]# mv harbor-offline-installer-0.5.0.tgz  /opt/
 2     [root@docker02 opt]# tar zxvf harbor-offline-installer-0.5.0.tgz 
 3     [root@docker02 harbor]# vim harbor.cfg
 4     ## Configuration file of Harbor
 5     #The IP address or hostname to access admin UI and registry service.
 6     #DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
 7     hostname = 172.16.138.101   修改hostname
 8     #The protocol for accessing the UI and token/notification service, by default it is http.
 9     #It can be set to https if ssl is enabled on nginx.
10     ui_url_protocol = http
11     #Email account settings for sending out password resetting emails.
12     #Email server uses the given username and password to authenticate on TLS connections to host and act as identity.
13     #Identity left blank to act as username.
14     email_identity = 
15     email_server = smtp.mydomain.com

3、使用docker节点push 镜像到harbor

修改docker仓库地址

 1 [root@docker03 images]# vim /etc/sysconfig/docker
 2 ....
 3 # If you want to add your own registry to be used for docker search and docker
 4 # pull use the ADD_REGISTRY option to list a set of registries, each prepended
 5 # with --add-registry flag. The first registry added will be the first registry
 6 # searched.
 7 ADD_REGISTRY='--add-registry harbor.suixingpay.com'
 8 # If you want to block registries from being used, uncomment the BLOCK_REGISTRY
 9 # option and give it a set of registries, each prepended with --block-registry
10 # flag. For example adding docker.io will stop users from downloading images
11 # from docker.io
12 # BLOCK_REGISTRY='--block-registry'
13 # If you have a registry secured with https but do not have proper certs
14 # distributed, you can tell docker to not look for full authorization by
15 # adding the registry to the INSECURE_REGISTRY line and uncommenting it.
16 INSECURE_REGISTRY='--insecure-registry harbor.suixingpay.com'
17 # On an SELinux system, if you remove the --selinux-enabled option, you
18 .....

重启docker服务

1 [root@docker03 images]# systemctl restart docker.service

登录Harbor(密码:Harbor12345)

1 [root@docker03 images]# docker login harbor.suixingpay.com
2 Username: admin
3 Password:
4 Login Succeeded

导入镜像

 1 [root@docker03 images]# docker load -i heapster_grafana_v2.6.0-2.tar
 2 78dbfa5b7cbc: Loading layer [==================================================>] 130.9 MB/130.9 MB
 3 5f70bf18a086: Loading layer [==================================================>] 1.024 kB/1.024 kB
 4 0828a6c7d921: Loading layer [==================================================>] 90.27 MB/90.27 MB
 5 8683f0f614c9: Loading layer [==================================================>] 2.048 kB/2.048 kB
 6 a89b3190964f: Loading layer [==================================================>] 16.26 MB/16.26 MB
 7 ca627f7178ed: Loading layer [==================================================>] 110.1 kB/110.1 kB
 8 edec8b16494f: Loading layer [==================================================>] 4.096 kB/4.096 kB
 9 Loaded image ID: sha256:b4344393062633aad3f68fdee2ac195cfe9d618d6994ef3f3e03dba088a15fa8
10 [root@docker03 images]#

给镜像打tag

 1 [root@docker03 images]# docker images
 2 REPOSITORY                                         TAG                 IMAGE ID            CREATED             SIZE
 3 harbor.suixingpay.com/kube/dnsmasq-metrics-amd64   1.0                 5271aabced07        8 months ago        14 MB
 4                                                            b43443930626        16 months ago       230 MB
 5 [root@docker03 images]# docker tag b43443930626 harbor.suixingpay.com/kube/heapster_grafana:v2.6.0-2
 6 [root@docker03 images]# docker images
 7 REPOSITORY                                         TAG                 IMAGE ID            CREATED             SIZE
 8 harbor.suixingpay.com/kube/dnsmasq-metrics-amd64   1.0                 5271aabced07        8 months ago        14 MB
 9 harbor.suixingpay.com/kube/heapster_grafana        v2.6.0-2            b43443930626        16 months ago       230 MB
10 [root@docker03 images]#

上次镜像到harbor

 1 [root@docker03 images]# docker push harbor.suixingpay.com/kube/heapster_grafana:v2.6.0-2
 2 The push refers to a repository [harbor.suixingpay.com/kube/heapster_grafana]
 3 5f70bf18a086: Mounted from kube/dnsmasq-metrics-amd64
 4 edec8b16494f: Pushed
 5 ca627f7178ed: Pushed
 6 a89b3190964f: Pushed
 7 8683f0f614c9: Pushed
 8 0828a6c7d921: Pushed
 9 78dbfa5b7cbc: Pushed
10 v2.6.0-2: digest: sha256:daea3fd319873e0f460b26885698a18c0dfcea404d0e03969aeaefeb35d4c278 size: 3018
11 [root@docker03 images]#

Harbor页面展示

 


推荐阅读
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • Redis底层数据结构之压缩列表的介绍及实现原理
    本文介绍了Redis底层数据结构之压缩列表的概念、实现原理以及使用场景。压缩列表是Redis为了节约内存而开发的一种顺序数据结构,由特殊编码的连续内存块组成。文章详细解释了压缩列表的构成和各个属性的含义,以及如何通过指针来计算表尾节点的地址。压缩列表适用于列表键和哈希键中只包含少量小整数值和短字符串的情况。通过使用压缩列表,可以有效减少内存占用,提升Redis的性能。 ... [详细]
  • 如何查询zone下的表的信息
    本文介绍了如何通过TcaplusDB知识库查询zone下的表的信息。包括请求地址、GET请求参数说明、返回参数说明等内容。通过curl方法发起请求,并提供了请求示例。 ... [详细]
  • 模板引擎StringTemplate的使用方法和特点
    本文介绍了模板引擎StringTemplate的使用方法和特点,包括强制Model和View的分离、Lazy-Evaluation、Recursive enable等。同时,还介绍了StringTemplate语法中的属性和普通字符的使用方法,并提供了向模板填充属性的示例代码。 ... [详细]
  • 本文详细介绍了git常用命令及其操作方法,包括查看、添加、提交、删除、找回等操作,以及如何重置修改文件、抛弃工作区修改、将工作文件提交到本地暂存区、从版本库中删除文件等。同时还介绍了如何从暂存区恢复到工作文件、恢复最近一次提交过的状态,以及如何合并多个操作等。 ... [详细]
  • 本文介绍了如何使用JSONObiect和Gson相关方法实现json数据与kotlin对象的相互转换。首先解释了JSON的概念和数据格式,然后详细介绍了相关API,包括JSONObject和Gson的使用方法。接着讲解了如何将json格式的字符串转换为kotlin对象或List,以及如何将kotlin对象转换为json字符串。最后提到了使用Map封装json对象的特殊情况。文章还对JSON和XML进行了比较,指出了JSON的优势和缺点。 ... [详细]
  • Android实战——jsoup实现网络爬虫,糗事百科项目的起步
    本文介绍了Android实战中使用jsoup实现网络爬虫的方法,以糗事百科项目为例。对于初学者来说,数据源的缺乏是做项目的最大烦恼之一。本文讲述了如何使用网络爬虫获取数据,并以糗事百科作为练手项目。同时,提到了使用jsoup需要结合前端基础知识,以及如果学过JS的话可以更轻松地使用该框架。 ... [详细]
  • 本文介绍了H5游戏性能优化和调试技巧,包括从问题表象出发进行优化、排除外部问题导致的卡顿、帧率设定、减少drawcall的方法、UI优化和图集渲染等八个理念。对于游戏程序员来说,解决游戏性能问题是一个关键的任务,本文提供了一些有用的参考价值。摘要长度为183字。 ... [详细]
  • STL迭代器的种类及其功能介绍
    本文介绍了标准模板库(STL)定义的五种迭代器的种类和功能。通过图表展示了这几种迭代器之间的关系,并详细描述了各个迭代器的功能和使用方法。其中,输入迭代器用于从容器中读取元素,输出迭代器用于向容器中写入元素,正向迭代器是输入迭代器和输出迭代器的组合。本文的目的是帮助读者更好地理解STL迭代器的使用方法和特点。 ... [详细]
  • 基于移动平台的会展导游系统APP设计与实现的技术介绍与需求分析
    本文介绍了基于移动平台的会展导游系统APP的设计与实现过程。首先,对会展经济和移动互联网的概念进行了简要介绍,并阐述了将会展引入移动互联网的意义。接着,对基础技术进行了介绍,包括百度云开发环境、安卓系统和近场通讯技术。然后,进行了用户需求分析和系统需求分析,并提出了系统界面运行流畅和第三方授权等需求。最后,对系统的概要设计进行了详细阐述,包括系统前端设计和交互与原型设计。本文对基于移动平台的会展导游系统APP的设计与实现提供了技术支持和需求分析。 ... [详细]
  • 本文整理了Java中org.gwtbootstrap3.client.ui.Icon.addDomHandler()方法的一些代码示例,展示了Icon.ad ... [详细]
  • Python中的PyInputPlus模块原文:https ... [详细]
  • 工作经验谈之-让百度地图API调用数据库内容 及详解
    这段时间,所在项目中要用到的一个模块,就是让数据库中的内容在百度地图上展现出来,如经纬度。主要实现以下几点功能:1.读取数据库中的经纬度值在百度上标注出来。2.点击标注弹出对应信息。3 ... [详细]
  • 可空类型可空类型主要用于参数类型声明和函数返回值声明。主要的两种形式如下: ... [详细]
  • Apple iPad:过渡设备还是平板电脑?
    I’vebeenagonizingoverwhethertopostaniPadarticle.Applecertainlydon’tneedmorepublicityandthe ... [详细]
author-avatar
守护琳的心
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有