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文 ...
随机推荐
- MySQL慢日志查询分析方法与工具
MySQL中的日志包括:错误日志.二进制日志.通用查询日志.慢查询日志等等.这里主要介绍下比较常用的两个功能:通用查询日志和慢查询日志. 1)通用查询日志:记录建立的客户端连接和执行的语句. 2)慢查 ...
- Filco圣手二代双模蓝牙机械键盘连接方法
转自:https://www.cnblogs.com/goldenSky/p/11437780.html 常规方法 确认键盘的电源接通. 同时按下「Ctrl」+「Alt」+「Fn」执行装置切换模式.配 ...
- hashmap与hashtable的本质区别
HashMap 底层数据结构是哈希表.线程不安全,效率高 哈希表依赖两个方法:hashCode()和equals() 执行顺序: ...
- 钉钉企业内部H5微应用开发
企业内部H5微应用开发 分为 服务端API和前端API的开发,主要涉及到进入应用免登流程和JSAPI鉴权. JSAPI鉴权开发步骤: 1.创建H5微应用 登入钉钉开放平台(https://open-d ...
- head中的base标签:设置超链接的默认行为
默认情况下,如果不指定超链接的target属性,则在当前窗口打开.使用head中的base可以制定超链接的base类,一切超链接都会继承它的属性. <html> <head> ...
- Xcode修改项目名称
http://blog.sina.com.cn/s/blog_a42013280101blxo.html
- 通过Request对象获取请求的IP地址
/** * 标识要从哪些消息头中获取IP地址 */ private static final String[] getIpArray = {"HTTP_X_FORWARDED_FOR&quo ...
- conan使用(二)--创建私有仓库
前面我们已经能够使用conan来从公共服务器上拉取C/C++包来集成进我的工程中,但是在实际开发中,我们可能需要自己封装或使用非公开的库,那么自己搭建一个私服是个很现实的需求. 搭建conan私服有几 ...
- JS高阶---instanceof
一句话: .
- 201871010112-梁丽珍《面向对象程序设计(java)》第八周学习总结
项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.com/nwnu-daizh/p ...