CentOS7 Harbor 安装
安装Harbor,首先要安装docker 和 docker-compose
$ yum install -y yum-utils device-mapper-persistent-data lvm2
$ yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
$ yum makecache fast
$ yum -y install docker-ce
$ systemctl start docker
$ curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose
$ yum install bash-completion
$ curl -L https://raw.githubusercontent.com/docker/compose/1.16.1/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
$ docker-compose --version
$ wget -P /usr/local/src/ https://github.com/vmware/harbor/releases/download/v1.2.0/harbor-online-installer-v1.2.0.tgz
$ tar zxf harbor-online-installer-v1.2.0.tgz -C /usr/local/
$ cd /usr/local/harbor/
$ vim /usr/local/harbor/harbor.cfg
➜ Please set hostname and other necessary attributes in harbor.cfg first. DO NOT use localhost or 127.0.0.1 for hostname, because Harbor needs to be accessed by external clients.
Please set --with-notary if needs enable Notary in Harbor, and set ui_url_protocol/ssl_cert/ssl_cert_key in harbor.cfg bacause notary must run under https.
Please set --with-clair if needs enable Clair in Harbor
$ ./install.sh


查看Harbor
# docker-compose ps
启动Harbor
# docker-compose start
停止Harbor
# docker-comose stop
重启Harbor
# docker-compose restart
ERROR: for nginx UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)
ERROR: for harbor-log UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
$ vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://njrds9qc.mirror.aliyuncs.com"],
"insecure-registries":["192.168.38.23"]
}
然后依次执行如下命令:
$ docker-compose stop
$ systemctl daemon-reload
$ systemctl restart docker
$ docker-compose up -d
docker tag 83f3f8af3613 192.168.38.23/library/tomcat:7.0.69-jre7
$ docker login 192.168.38.23
Username: admin
Password:
用户名密码:admin / Harbor12345
备注:如果登录时出现 Error response from daemon: Get http://192.168.38.23/v2/: Get http://harbor/service/token?account=admin&client_id=docker&offline_token=true&service=harbor-registry: dial tcp: lookup harbor on 192.168.38.2:53: no such host.
则需要执行第5步操作,配置TLS证书
(4)客户端push
push命令格式: docker push harbor/library/IMAGE[:TAG]
$ docker push 192.168.38.23/library/tomcat:7.0.69-jre7
hostname = 192.168.38.23
ui_url_protocol = https
ssl_cert = /etc/certs/ca.crt
ssl_cert_key = /etc/certs/ca.key
$ mkdir /etc/certs
$ openssl genrsa -out /etc/certs/ca.key 2048
Generating RSA private key, 2048 bit long modulus
....+++
..................................................+++
e is 65537 (0x10001)
$ openssl req -x509 -new -nodes -key /etc/certs/ca.key -subj "/CN=192.168.38.23" -days 5000 -out /etc/certs/ca.crt
$ ./install.sh
$ mkdir -p /etc/docker/certs.d/192.168.38.23
$ scp /etc/certs/ca.crt root@192.168.38.21:/etc/docker/certs.d/192.168.38.23/
$ systemctl restart docker
$ docker login 192.168.38.23
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
$ docker push 192.168.38.23/library/tomcat:7.0.69-jre7
push成功后登录Harbor可查看刚才上传的镜像,这里的链接地址也变成了https了 https://192.168.38.23/harbor/sign-in

CentOS7 Harbor 安装的更多相关文章
- Harbor 学习分享系列1 - centos7.4安装harbor1.5.2
centos7.4安装harbor1.5.2 前言 本系列分享将Harbor有关教程:分享形式会以百度云盘的形式进行分享,主要教程将以markdown格式进行分享:建议使用markdownpad2这款 ...
- Centos7 docker、harbor 安装配置
Docker 安装 wget -O /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-7.repo wget ...
- (一)Harbor安装 -- 企业级Registry仓库
根据Harbor官方描述: Harbor是一个用于存储和分发Docker镜像的企业级Registry服务器,通过添加一些企业必需的功能特性,例如安全.标识和管理等,扩展了开源Docker Distri ...
- Harbor安装 -- 企业级Registry仓库
(一)Harbor安装 -- 企业级Registry仓库 以下文章转自http://www.jianshu.com/p/2ebadd9a323d 根据Harbor官方描述: Harbor是一个用于存储 ...
- Docker私服仓库Harbor安装
Harbor安装那里还是很简单,就是在Docker Login那里掉坑里去了,搞半天,写博客的时候,又重新安装了一遍 1.准备两台服务器 centos7 harbor 10.19.46.15 clie ...
- Harbor 安装教程
Harbor 安装教程 一. CentOS设置 1. 更换阿里源 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com ...
- Harbor2.2.4在CentOS7.9安装、部署
CentOS7.9基础环境配置 https://www.cnblogs.com/uncleyong/p/15471002.html 直接从网盘获取配置好的环境 修改:vim /etc/hosts 12 ...
- 在centos7上安装Jenkins
在centos7上安装Jenkins 安装 添加yum repos,然后安装 sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins ...
- CentOS7 Jenkins安装
CentOS7 Jenkins安装 CentOS7 Jenkins安装 Download 从Jenkins下载apache-tomcat-8.0.18.tar.gz Install 安装 上传RPM文 ...
随机推荐
- Elastic Beats介绍
需要学习的地方:概念,用法,模块使用 Elastic Beats介绍 Elastic Stack传统上由三个主要组件(Elasticsearch,Logstash和Kibana)组成,早已脱离了这种组 ...
- 排障利器之远程调试与监控 --jmx & remote debug
监控和调试功能是应用必备的属性之一,其手段也是多种多样. 一般地,我们可以通过:线上日志, zabbix, grafana, cat 等待系统做一问题留底,有问题及时报警,从而达到监控效果. 而对于应 ...
- 嵌入式Linux+NetCore 笔记一
记录嵌入式Linux+NetCore培训中遇到的一些问题以及解决方法 十一放假期间发现园里大神大石头(NewLife团队)开了一个嵌入式Linux+NetCore培训,就报名参加了.更幸运的是,我刚好 ...
- 分享windows 10 下部署 elasticsearch 和 logstash (二)
接上一篇,es部署很简单,很快就弄好了. 但是还是有很多不玩美. 比如说:主机是本地的IP或机器名,端口是固定的9200. 而且是只有一个节点,我要在一台机器上部署多个节点呢. 经过一段时间的摸索,做 ...
- 如何通过调优攻破 MySQL 数据库性能瓶颈?
一.前言 MySQL调优对于很多程序员而言,都是一个非常棘手的问题,多数情况都是因为对数据库出现问题的情况和处理思路不清晰.在进行MySQL的优化之前必须要了解的就是MySQL的查询过程,很多的查询优 ...
- ASP.NET Core MVC 之依赖注入 View
ASP.NET Core 支持在试图中使用依赖注入.这将有助于提供视图专用的服务,比如本地化或者仅用于填充视图元素的数据.应尽量保持控制器和视图之间的关注点分离.视图所显示的大部分数据应该从控制器传入 ...
- Java异常相关知识总结
异常: 概述:java程序运行过程中出现的错误 常见的异常: StackOverflowError ArrayIndexOutOfBoundsException NullPointerExceptio ...
- flux架构的详细介绍和使用!
结构分为四个 视图 view动作 action派发器 dispatcher数据商店 store 流程: 用户操作视图 视图(view)发送动作(action)到派发器(dispatcher) 由派发器 ...
- 【入门篇】前端框架Vue.js知识介绍
一.Vue.js介绍 1.什么是MVVM? MVVM(Model-View-ViewModel)是一种软件架构设计模式,它源于MVC(Model-View-Controller)模式,它是一种思想,一 ...
- 第九届极客大挑战——小帅的广告(二阶sql注入)
也是经过一通扫描和测试,没发现其他有用信息,感觉这是个sql注入.其实对于二阶sql注入我以前没实践过,也没看过资料,只是知道这个名字,但不知道为何看到这道题就让我回想起了这个名词,所以查了一下二阶s ...