当前位置:网站首页>Harbor container installation and related feature deployment and use (SSL certificate +ad domain)
Harbor container installation and related feature deployment and use (SSL certificate +ad domain)
2022-06-09 04:06:00 【Glomi loves learning】
Step one : Deploy Docker Containers (Https)
Go to the download page https://github.com/goharbor/harbor/releases, Download the online or offline installation package as required . The online installation package does not contain image files .
Imported to deployment docker Of Linux in , And extract the file :
tar xzvf harbor-online-installer-version.tgz
perhaps :
tar xzvf harbor-offline-installer-version.tgz
After decompression , Start HTTPs Related configuration . The first is to create CA The private key :
openssl genrsa -out ca.key 4096
Then create a CA Certificate
openssl req -x509 -new -nodes -sha512 -days 3650 \
-subj "/C=CN/ST=Beijing/L=Beijing/O=example/OU=Personal/CN=yourdomain.com" \
-key ca.key \
-out ca.crt
X.509 A certificate consists of several fields . The Subject Domain is one of the most relevant domains for this tutorial . It gives the client to which the certificate belongs DName.DName It's giving X.500 Unique name of the directory object . It is called a relatively distinguished name by many (RDN) Property value pairs of . Some of the most common RDN And its explanation is as follows :
- CN: Common name
- OU: Organizational unit
- O: organization
- L: place
- S: The name of the state or province
- C: The name of the country
for example :
openssl req -x509 -new -nodes -sha512 -days 3650 \
-subj "/C=UK/ST=Wales/L=Cardiff/O=Cardiff University/OU=Headquarter/CN=project.com" \
-key ca.key \
-out ca.crt
Generate CA Private key and certificate , Need generation Harbor Private key and certificate for :
Generate private key command :
openssl genrsa -out yourdomain.com.key 4096
In subsequent articles ,yourdomain.com.key The actual name will be used instead of :
openssl genrsa -out harbor.project.com.key 4096
Next , Generate Harbor Certificate request file for :
openssl req -sha512 -new \
-subj "/C=UK/ST=Wales/L=Cardiff/O=Cardiff University/OU=Headquarter/CN=harbor.project.com" \
-key harbor.project.com.key \
-out harbor.project.com.csr
To configure x509 v3 Expand the file , This file is configured to help generate alternate names that match the topic (SAN) and x509 v3 Certificate file required for certificate extension of . among ,SAN Or topic alternate names are a structured way , Used to indicate all domain names and protected by the certificate IP Address . Be regarded as SAN The short list of items for includes subdomains and IP Address . The format of the file is as follows :
cat > v3.ext <<-EOF authorityKeyIdentifier=keyid,issuer basicConstraints=CA:FALSE keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment extendedKeyUsage = serverAuth subjectAltName = @alt_names [alt_names] DNS.1=yourdomain.com DNS.2=yourdomain DNS.3=hostname EOF
Examples are as follows :
cat > v3.ext <<-EOF authorityKeyIdentifier=keyid,issuer basicConstraints=CA:FALSE keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment extendedKeyUsage = serverAuth subjectAltName = @alt_names [alt_names] DNS.1=harbor.project.com DNS.2=harbor.project DNS.3=harbor EOF
When the configuration is complete , Use this file and openssl by Harbor Generate Certificate :
openssl x509 -req -sha512 -days 3650 \
-extfile v3.ext \
-CA ca.crt -CAkey ca.key -CAcreateserial \
-in harbor.project.com.csr \
-out harbor.project.com.crt
Now? , We have what we need to use later ca Certificate ,harbor Private key and certificate for .
Be careful : If you want to use your own CA, for example window server Medium CA by harbor Issue certificate . Please directly use the following website to generate certificate requests and private key files that meet the requirements : https://decoder.link/csr_generator

Next , We need to give Harbor Container add Certificate . Because volume mapping is used when deploying containers , So we're going directly to Harbor Copy the private key and certificate of to the host /data/cert Under the directory :
cp harbor.project.com.crt /data/cert
cp harbor.project.com.key /data/cert
After completion , transformation harbor.project.com.crt by harbor.project.cert, for Docker Use .Docker The daemons will .crt The document is interpreted as CA certificate , take .cert The document is interpreted as Harbor certificate .
openssl x509 -inform PEM -in harbor.project.com.crt -out harbor.project.com.cert
Create a storage verification Harbor Of the container certificate Docker The catalog of , And will Harbor The private key , certificate , as well as CA Copy the certificate of :
mkdir -p /etc/docker/certs.d/harbor.project.com/
cp harbor.project.com.cert /etc/docker/certs.d/harbor.project.com/
cp harbor.project.com.key /etc/docker/certs.d/harbor.project.com/
cp ca.crt /etc/docker/certs.d/harbor.project.com/
After completion , After decompression Harbor Under the table of contents , Find the following harbor.yml file , And modify the contents :
The specific parameters are as follows :https://goharbor.io/docs/2.1.0/install-config/configure-yml-file/. When the configuration is complete , Still in the unzipped Directory , find install.sh file , Use the following command to harbor Deployment of :
sudo ./install.sh
Be careful , The prerequisite for this step is to install a that meets the version requirements docker-compose, Otherwise, an error will be reported . After installation , Verify that the container is running successfully :
You can see , The States here are healthy, No problem . Next , We can access it by command or viewer Harbor Mirror warehouse .
CLI The order is as follows :
docker login harbor.project.com -u admin -p Harbor12345

Next is Web land , Access the host's 443 Https Port can :
Step two : Connect AD Domain
First , Configure your own AD Domain , And create the corresponding Harbor Landing user . as follows , I have finished configuring AD Domain project.com And the user HarborAdmin
complete AD After domain configuration , stay Harbor Connection in progress :
To configure AD Parameters of domain connection . The specific parameters are explained as follows : https://docs.bmc.com/docs/fpsc121/ldap-attributes-and-associated-fields-495323340.html
After the configuration is completed, you can click the test button at the bottom of the page to check whether it can be connected normally . If the test is successful , You can save the configuration .
Next, you can click on the user management bar , by HarborAdmin Set administrator permissions :
After setting up , We can logout And use AD Login with the account of the domain Harbor The warehouse .
Step three :Push+Pull Mirror image
CLI Command line login Harbor after , You can mirror our image Push Store in a private warehouse . First, in the Harbor Create private warehouse in :
Next, you need to mark the image tag,tag The format is :
docker tag SOURCE_IMAGE[:TAG] harbor.project.com/project_images1/IMAGE[:TAG]
for example , We want to push nginx:latest Mirror to Harbor, Then use the following command :
docker tag nginx:latest harbor.project.com/project_images1/nginx:v1
After the modification is completed , We can use the following command , Push the mirror image to Harbor In the private warehouse of :
docker push harbor.project.com/project_images1/nginx:v1
stay Harbor Check in , You can see that the push has been successful :
In the same way pull Mirror to local :
docker pull harbor.project.com/project_images1/nginx:v1
Reference material :https://goharbor.io/docs/2.1.0/install-config/
边栏推荐
- Memory surge problem location
- 未知宽高元素水平垂直都居中的实现方法
- 【word】錯誤!文檔中沒有指定樣式的文字。 1
- JS reverse font reverse crawling, a supplier platform reverse crawling practice
- 基于FPGA的VGA显示彩条、字符、图片
- HashRouter 和 HistoryRouter的区别和原理
- Handling of missing data in ArcGIS runtime offline GDB
- Kubernetes binary installation (v1.20.16) (IV) deployment master
- [软件工具][教程]一个很好用的可以将csdn博客文章导出word的工具使用教程
- MySQL: common statistics, grouping statistics and time format conversion
猜你喜欢

Memory surge problem location

Apple Announces Winner of the 2022 Apple Design Award

How to use superset to seamlessly connect with MRS for self-service analysis

2022年【电商】测试优惠券如何编写测试用例?

从刚入测试界到薪资翻倍:聊聊我的测试进阶历程,值得借鉴

我的创作纪念日

【优秀毕设】基于OpenCV的人脸识别打卡/签到/考勤管理系统(最简基本库开发、可基于树莓派)

『C语言』面试管:说下各个字符串函数功能,我:不知道。面试官:小伙子学会了再来面试吧。

Experts, how to quickly transform managers?

《Attention-ocr-Chinese-Version-mas # ter》代码运行逻辑
随机推荐
Attention OCR Chinese version mas ter code running logic
Is it safe to open an account in Hongye futures?
Six C language final assignments KTV song selection, personal revenue and expenditure management, staff resource management, class student file management, product information management, library mana
【优秀毕设】基于OpenCV的人脸识别打卡/签到/考勤管理系统(最简基本库开发、可基于树莓派)
Unity first person shooting game, shooting game, with complete functions, can be used as a major assignment or completion
微信小程序:(异常)Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ 解决方案和分析流程(这里一定有你要的答案)
MySQL:常用的统计、分组统计、时间格式转换
C language interview tube: talk about the functions of various string functions. I: I don't know. Interviewer: come back for an interview when the young man has learned how to do it.
[learn FPGA programming from scratch -14]: quick start chapter - operation step 3 (functional simulation) -3-modelsim quick start (8bits cycle counter)
php反序列化复现——bugku 点login没反应
C#. Net calling dynamic library DLL
Final assignment of Web Design - website of XXX company (including navigation bar, rotation chart, etc.)
Matting interface based on pyqt5
Pdf merge based on pyqt5
Matting function based on pyqt5 - program implementation
基于PyQt5完成的pdf转word
[share] network packet loss fault handling scheme
Winform UI界面设计例程——自定义控件progressBar
Online Morse code online translation and conversion tool
ES6之Symbol详解