harbor Configuring Harbor with HTTPS Access
首先,下载fq (fanqiang) harbor-offline-installer-v1.2.0-rc5.tgz
tar xvf harbor-offline-installer-<version>.tgz
本文参考(https://github.com/vmware/harbor/blob/master/docs/configure_https.md )
- Create your own CA certificate:
openssl req \
-newkey rsa:4096 -nodes -sha256 -keyout ca.key \
-x509 -days 365 -out ca.crt
- Generate a Certificate Signing Request:
If you use FQDN like reg.yourdomain.com to connect your registry host, then you must use reg.yourdomain.com as CN (Common Name). Otherwise, if you use IP address to connect your registry host, CN can be anything like your name and so on:
openssl req \
-newkey rsa:4096 -nodes -sha256 -keyout yourdomain.com.key \
-out yourdomain.com.csr
- Generate the certificate of your registry host:
If you're using IP, say 10.1.1.5 to connect your registry host, you may instead run the command below:
echo subjectAltName = IP:10.1.1.50 > extfile.cnf
openssl x509 -req -days 365 -in 10.1.1.5.csr -CA ca.crt -CAkey ca.key -CAcreateserial -extfile extfile.cnf -out 10.1.1.50.com
.crt
Configuration and Installation
After obtaining the yourdomain.com.crt and yourdomain.com.key files, you can put them into directory such as/root/cert/:
cp 10.1.1.50.crt /root/cert/
cp 10.1.1.50.key /root/cert/
Next, edit the file make/harbor.cfg , update the hostname and the protocol, and update the attributes ssl_cert andssl_cert_key:
#set hostname
hostname = 10.1.1.50
#set ui_url_protocol
ui_url_protocol = https
......
#The path of cert and key files for nginx, they are applied only the protocol is set to https
ssl_cert = /root/cert/10.1.1.50.crt
ssl_cert_key = /root/cert/10.1.1.50.key
Generate configuration files for Harbor:
./prepare
Finally, restart Harbor:
docker-compose up -d
After setting up HTTPS for Harbor, you can verify it by the following steps:
Open a browser and enter the address: https://10.1.1.50 . It should display the user interface of Harbor.
docker login reg.yourdomain.com
(admin/Harbor12345) --succeed
Troubleshooting
You may get an intermediate certificate from a certificate issuer. In this case, you should merge the intermediate certificate with your own certificate to create a certificate bundle. You can achieve this by the below command:
[
自签CA证书:
cd /etc/pki/CA
touch index.txt
echo 01 > serial
openssl genrsa -out /etc/pki/CA/private/cakey.pem 2048
chmod 600 private/cakey.pem
openssl req -new -x509 -key /etc/pki/CA/private/cakey.pem -days 7300 -out /etc/pki/CA/cacert.pem
cd /etc/docker/certs.d/
mkdir 10.1.1.50
cd 10.1.1.50/
cp /etc/pki/CA/cacert.pem ./
cat /etc/pki/CA/cacert.pem >> /etc/pki/tls/certs/ca-bundle.crt
systemctl restart docker
docker-compose stop
docker-compose up -d
docker-compose ps
]

harbor Configuring Harbor with HTTPS Access的更多相关文章
- 【Docker】企业级镜像仓库harbor的搭建(http/https)及使用
一:用途 Harbor是一个用于存储和分发Docker镜像的企业级Registry服务器. 二:安装docker-ce 环境:阿里云轻量应用服务器CentOS 7.3 这里通过yum Docker源仓 ...
- Configuring HTTP and HTTPS
Configuring HTTP and HTTPS .NET Framework (current version) Other Versions WCF services and clie ...
- (七)VMware Harbor 问题:Get https://192.168.3.135:8088/v2/: http:server gave HTTP response to HTTPS client
(一)问题描述 登陆时,报错 docker Get https://192.168.3.135:8088/v2/: http:server gave HTTP response to HTTPS cl ...
- harbor官方关于创建https的有关命令
官方地址:https://goharbor.io/docs/2.0.0/install-config/configure-https/ 命令总结: openssl genrsa -out ca.key ...
- Installation and Configuration Guide
Harbor can be installed by one of three approaches: Online installer: The installer downloads Harbor ...
- Docker 私有仓库 Harbor registry 安全认证搭建 [Https]
Harbor源码地址:https://github.com/vmware/harborHarbort特性:基于角色控制用户和仓库都是基于项目进行组织的, 而用户基于项目可以拥有不同的权限.基于镜像的复 ...
- 私有仓库harbor安装包括https
1. 下载离线的 harbor gz包 wget https://github.com/vmware/harbor/releases/download/v1.2.0/harbor-offline-in ...
- Harbor + Https 部署
关闭防火墙和selinux systemctl stop firewalld sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/sysconfig/selin ...
- K8S集群集成harbor(1.9.3)服务并配置HTTPS
一.简介 简介请参考:https://www.cnblogs.com/panwenbin-logs/p/10218099.html 二.安装Harbor主机环境及安装要求 主机环境: OS: Cent ...
随机推荐
- 微信小程序下拉框之二维数组或对象
在项目中,我们大多数时候传的值并不是需要这个下标,而是其他的值.像我项目中,需要获取到的是它对应的Id,那么我们如何通过它的这个下标值返回你想要的值呢? 通过picker返回的索引值,去获取匹配你想获 ...
- CSS之fontAwesome代替网页icon小图标
引言 奥森图标(Font Awesome)提供丰富的矢量字体图标—通过CSS可以任意控制所有图标的大小 ,颜色,阴影. 网页小图标到处可见,如果一个网页都是干巴巴的文字和图片,而没有小图标,会显得非常 ...
- CSS总结div中的内容垂直居中的五种方法
一.行高(line-height)法 如果要垂直居中的只有一行或几个文字,那它的制作最为简单,只要让文字的行高和容器的高度相同即可,比如: p { height:30px; line-height:3 ...
- 《数据库系统概念》10-ER模型
通过建立实体到概念模型的映射,Entity-Relationship Model可以表达整个数据库的逻辑结构,很多数据库产品都采用E-R模型来表达数据库设计. 一.E-R模型采用了三个基本概念:实体集 ...
- Unity3D开发之3D按钮的声音播放
这里我们首先就简易的制作一个非常简单的3D按钮![ 图中就一个cube 加个3DText,然后我们就编写代码 [RequireComponent(typeof(CompoundButton))]//特 ...
- Jenkins修改workspace和build目录
Jenkins: Change Workspaces and Build Directory Locations 转自: http://ingorichter.blogspot.jp/2012/02 ...
- mysqld_safe启动服务器总结
mysqld_safe是服务端工具,用于启动mysqld,并且是mysqld的守护进程,mysqld_safe加&在后台运行$BASEDIR/bin/mysqld_safe & 优点就 ...
- 浅copy与深copy举例
例1: #!/usr/bin/env python import copy d1 = {'x':1,'y':2,'z':[3,4.5]} d2 = d1 d3 = d1.copy() d4 = co ...
- MySQL表名区分大小写设置
关闭MySQL服务 在服务运行目录找到my.ini或者my.cnf文件 打开文件,找到[mysqld]在下面增加一行 lower_case_table_names=0 (0:大小写敏感;1:大小写不敏 ...
- centos7下安装docker(3.1创建镜像commit)
docker commit创建镜像 步骤:1.运行容器 2.修改容器 3.将容器保存为镜像 1. 注:-it是以交互模式进入容器,并打开终端 2.安装一个vim进行修改镜像 yum install - ...