Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Docker Image Warehouse Harbor

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how to use Docker image warehouse Harbor, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

1 install Docker

Cd / etc/yum.repos.dwget https://download.docker.com/linux/centos/docker-ce.repoyum install docker-ce-ysystemctl start dockersystemctl enable docker

2 install docker-compose

Curl-L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname-s`-`uname-m`-o / usr/local/bin/docker-composechmod + x / usr/local/bin/docker-composedocker-compose version

3 download the Harbor installation package

Offline address wget https://storage.googleapis.com/harbor-releases/release-1.7.0/harbor-offline-installer-v1.7.4.tgz online address wget https://storage.googleapis.com/harbor-releases/release-1.7.0/harbor-online-installer-v1.7.4.tgz

Decompress: (use offline package)

Tar xf harbor-offline-installer-v1.7.4.tgz

4 self-signed certificate

Cd harbormkdir ssl & & cd ssl # use openssl genrsa-out ca.key 4096openssl req-x509-new-nodes-sha512-days 3650\-subj "/ C=CN/ST=PK/L=PK/O=example/OU=Personal/CN=fuck1899.com"\-key ca.key\-out ca.crtopenssl genrsa-out fuck1899.com.key 4096openssl req-sha512-new\-subj "/ C=CN/ST=PK/L=PK/O=example/OU=Personal/CN=fuck1899.com"\-key fuck1899.com.key\ -out fuck1899.com.csr cat > v3.ext 443/tcp 0.0.0.0 4443-> 4443/tcp, 0.0.0.0 VR 80-> 80/tcp redis docker-entrypoint.sh redis... Up 6379/tcp registry / entrypoint.sh / etc/regist... Up 5000/tcp registryctl / harbor/start.sh Up

6 browser access test

You need to add a native host file to access the signature, because this domain name is not real

Linux add hosts file

47.244.163.105 fuck1899.com

Windows add hosts file

C:\ Windows\ System32\ drivers\ etc

Edit hosts to add:

Server IP fuck1899.com

But it is shown to be unsafe.

Check whether the certificate has been issued by us.

The above picture shows that the certificate was issued by us.

Official explanation

Note that even if we sign the certificate through the self-signed CA and deploy the CA to the above location, some browsers may still display an unknown warning about the certificate authority (CA) for security reasons. This is because the self-signed CA is not essentially a trusted third-party CA. You can import CA into the browser yourself to resolve the warning.

7 landing

The default password is admin Harbor12345 if you haven't changed it.

Login on linux side

Docker login yourdomain.com

Windows opens the address directly

8 create a project, etc.

Create Project 1 Public 2 do not publicly create user associated project 1 add member 2 role authorization

9 harbor upload / download image

The first step is to log in and enter the user name and password

Docker login fuck1899.com face interactive login: docker login-u user name-p password image server

The second step is to tag the image

Docker tag oddrationale/docker-shadowsocks fuck1899.com/sundezhao/ss:v1#oddrationale/docker-shadowsocks requires a large tag image # fuck1899.com harbor server # sundezhao project name # ss:v1 tag

Step 3: push image

Docker push fuck1899.com/sundezhao/ss:v1

Step 4: check the images that have already been push

Step 5 pull image

Docker pull fuck1899.com/sundezhao/ss:v1

10 harbor built-in mirror scan

1) install the image scanning tool

#. / install.sh-with-clair

2) use

3) late maintenance

Sudo docker-compose-f. / docker-compose.yml-f. / docker-compose.clair.yml down-vvim harbor.cfgsudo prepare-- with-clairsudo docker-compose-f. / docker-compose.yml-f. / docker-compose.clair.yml up-d is all the contents of the article "how to use Harbor in Docker Image Repository". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report