当前位置:网站首页>Enterprise image warehouse
Enterprise image warehouse
2022-06-24 05:14:00 【Mars. zhang】
Harbor
Harbor yes VMware The company's latest open source enterprise class Docker Registry project , Its goal is to help users quickly build an enterprise class Docker registry service , You can store your own image and have security authentication .
One 、 Environmental requirements
harbor Need to install docker 17.06.0-ce+ and docker-compose 1.18.0+ Can be used
Two 、 install docker-ce
To configure yum Source
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
install docker-ce
yum -y install docker-ce-18.06.1.ce-3.el7 systemctl enable docker && systemctl start docker
3、 ... and 、 install docker-compose
install docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
2. Add executable rights
sudo chmod +x /usr/local/bin/docker-compose
3. Validation version
docker-compose --version
explain :Docker Compose yes docker A command line tool provided , Used to define and run applications made up of multiple containers .
Use compose, We can go through YAML File declaratively defines the services of the application , And by a single command to complete the application creation and start .
Four 、 obtain Harbor Offline installer
Download website https://github.com/vmware/harbor/releases/
decompression :tar xvf harbor-offline-installer-v1.10.2.tgz
Edit profile :
vim harbor.yaml modify harbor The hostname in the configuration file (hostname) To be changed to :reg.syqedu.com( visit harbor Domain name or extranet IP) Change the directory path where the certificate is located : ssl_cert = /root/harbor/ssl/reg.syqedu.com.crt ssl_cert_key = /root/harbor/ssl/reg.syqedu.com.key change harbor The login password : harbor_admin_password = 12345
5、 ... and 、 Generate SSL certificate
Get into harbor Catalog :
mkdir ssl 【 Create certificate storage directory 】
cd ssl
1. Generate root certificate
openssl genrsa -out ca.key 4096 openssl req -x509 -new -nodes -sha512 -days 3650 -key ca.key -out ca.crt
2. Generate a certificate signature , Set the domain name to :reg.syqedu.com
openssl genrsa -out reg.syqedu.com.key 4096 openssl req -sha512 -new -key reg.syqedu.com.key -out reg.syqedu.com.csr
3.chrome The browser will check whether the current domain name is declared in the certificate , This statement is made by subjectAltName Field settings .
This field is not set by default in the above generation steps , The solution is as follows :
Create a v3.ext file :
cat > v3.ext <<-EOF authorityKeyIdentifier=keyid,issuer basicConstraints=CA:FALSE keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment extendedKeyUsage = serverAuth subjectAltName = @alt_names [alt_names] DNS.1=reg.syqedu.com DNS.2=reg.syqedu DNS.3=k8s-master # Host name EOF
Specify when the host certificate is finally generated v3.ext file
4. Generate host certificate
openssl x509 -req -sha512 -days 3650 -extfile v3.ext -CA ca.crt -CAkey ca.key -CAcreateserial -in reg.syqedu.com.csr -out reg.syqedu.com.crt
6、 ... and 、 Install through the built-in script
1. Execute configuration file : ./prepare
2. Then perform the installation :./install.sh
3. Lists whether the currently running container is healthy : docker-compose ps
4. Then bind hosts Just visit
7、 ... and 、 other docker Host access harbor
To put harbor Get the self signed certificate on docker On :
mkdir -p /etc/docker/certs.d/reg.syqedu.com
hold reg.syqedu.com.crt Copy it to this directory
docker login reg.syqedu.com # Sign in harbor Warehouse
Then upload the image to harbor:
docker tag tomcat:v1 reg.syqedu.com/test/tomcat:v1 # Marking
docker push reg.syqedu.com/test/tomcat:v1 # Upload
边栏推荐
- Introduction to ebpf
- Black horse programmer machine learning handout: preliminary use of linear regression API
- Zhang Xiaodan, chief architect of Alibaba cloud hybrid cloud: evolution and development of government enterprise hybrid cloud technology architecture
- What is the use of domain name cloud resolution? What are the factors for domain name errors
- Troubleshooting for the error message "[err] mod\u local\u stream.c:880 unknown source default" in easyrtc
- What is stored in the domain name server? How does the domain name server provide services?
- [July lottery, announcement of the winners] special sessions of "audio and video" and "Discuz! Q" of techo youth open classes in Colleges and Universities
- Verifying data models in golang
- Build your unique online image
- LeetCode 1662. Check whether two string arrays are equal
猜你喜欢

Leetcode (question 2) - adding two numbers
![[leetcode daily question] push domino](/img/81/1c31e97d9a245816514bcf47c92107.jpg)
[leetcode daily question] push domino

CTF learning notes 17:iwesec file upload vulnerability-02 file name filtering bypass

How does win10 turn off f1~f12 shortcut keys?

Intensive learning and application of "glory of the king" to complete the application of 7 real worlds other than human players

014_ TimePicker time selector

Leetcode question brushing (question 3) - the longest substring without repeated characters

"Emergency response practice" logparser log analysis practice

Introduction to the "penetration foundation" cobalt strike Foundation_ Cobalt strike linkage msfconsole

Leetcode (question 1) - sum of two numbers
随机推荐
What is the use of domain name cloud resolution? What are the factors for domain name errors
Training methods after the reform of children's programming course
CMU cs15-445 lecture01 relationship model course notes
The easyplayer player displays compileerror:webassembly Reason for instance() and its solution
How to expand virtual machine capacity on vSphere client
Where is the cheaper domain name? What should I pay attention to when buying a domain name?
Analyze the actual user groups and demand positioning of distributed database products from the market and demand
Bi-sql - Select
PTA 1082 shooting competition (20 points)
CTF learning notes 17:iwesec file upload vulnerability-02 file name filtering bypass
Critical service failed
Verifying data models in golang
Eigen eigenMatrix
3 minutes to understand JSON schema
How to clone virtual machines on vspere client
What server does domain name and IP address convert through? How does the server convert?
2021-08-27: the normal odometer will display natural numbers in turn to indicate mileage, Kyrgyzstan
Leetcode (question 1) - sum of two numbers
API service orchestration platform, full web visual orchestration
Mini web framework: adding routes in decorator mode | dark horse programmer