In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, the editor will bring you about how to install the enterprise docker image warehouse Harbor. The article is rich in content and analyzes and describes for you from a professional point of view. I hope you can get something after reading this article.
Official introduction of Harbor
Harbor is an enterprise-class Registry server for storing and distributing Docker images, extending open source Docker Distribution by adding some essential features of the enterprise, such as security, identity, and management. As an enterprise-class private Registry server, Harbor provides better performance and security. Improve the efficiency of users using Registry to build and run the environment to transfer images. Harbor supports replication of image resources installed on multiple Registry nodes, and all images are stored in private Registry to ensure that data and intellectual property rights are controlled in the company's internal network. In addition, Harbor also provides advanced security features, such as user management, access control and activity auditing.
Harbor installation environment Centos: CentOS 7.3Docker: 18.03.1-ceDocker-composer: 1.23.2Harbor: harbor-online-installer-v1.6.2.tgz
You can refer to docker- to install docker engine/docker compose in centos7 and windows10 installation, docker- Image Accelerator and docker-compose installation, respectively.
Harbor 1.6.2 required operating environment: docker 17.03.0 Murce + and docker-compose 1.10.0 +.
Harbor installation
Harbor supports both online and offline installation, which is installed online in this paper. Docker images need to be downloaded during online installation, while offline packages already have related images.
Offline packages can be downloaded from Baidu cloud disk:
Link: https://pan.baidu.com/s/1hWeEu4J-o1LYFrFgWOmQww extraction code: q9q7
The online installation package can be downloaded at the following connection:
Link: https://pan.baidu.com/s/1FbB-QCB63k6psOtpOkvXYw extraction code: o72z
Upload the installation package harbor-online-installer-v1.6.2.tgz to the server
1. Decompress [root@localhost harbor] # tar xvf harbor-online-installer-v1.6.2.tgz2, configuration
In the extracted directory of harbor, there are the following files, where harbor.cfg is the configuration file and install.sh is the installation file
Drwxr-xr-x. 3 root root 23 Dec 9 22:41 common-rw-r--r--. 1 root root 813 Nov 20 13:59 docker-compose.chartmuseum.yml-rw-r--r--. 1 root root 863 Nov 20 13:59 docker-compose.clair.yml-rw-r--r--. 1 root root 1258 Nov 20 13:59 docker-compose.notary.yml-rw-r--r--. 1 root root 3675 Nov 20 13:59 docker-compose.ymldrwxr-xr-x. 3 root root 136 Nov 20 13:59 ha-rw-r--r--. 1 root root 7913 Nov 20 13:59 harbor.cfg-rwxr-xr-x. 1 root root 6162 Nov 20 13:59 install.sh-rw-r--r--. 1 root root 10768 Nov 20 13:59 LICENSE-rw-r--r--. 1 root root 482 Nov 20 13:59 NOTICE-rw-r--r--. 1 root root 1535603 Nov 20 13:59 open_source_license-rwxr-xr-x. 1 root root 39132 Nov 20 13:59 prepare
The following modifies the parameters used in some examples. For more detailed parameters, please refer to: https://github.com/goharbor/harbor/blob/v1.6.2/docs/installation_guide.md
Vim harbor.cfg
Modify the configuration to use the IP address to access harbor, and the exposed port is 5000
# listener address, which cannot be set to 127.0.0.1 or localhost. Here, the ip address of docker host is set to hostname = 192.168.88.30 hostname 500 login password. The default password is Harbor12345harbor_admin_password = 123456
Modify docker-compose.yml to map port 80 in the container to port 5000 in host
Proxy: image: goharbor/nginx-photon:v1.6.2 container_name: nginx restart: always volumes: -. / common/config/nginx:/etc/nginx:z networks:-harbor ports: # it needs to be changed here. Installation
Run install.sh in the installation directory. Wait patiently, if you are installing the version online, you need to download some docker images, which is quite fast if the docker-Image Accelerator is configured with an accelerator.
. / install.sh
The downloaded image is as follows:
[root@localhost harbor] # docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEgoharbor/redis-photon v1.6.2 473bfdd9d245 2 weeks ago 210MBgoharbor/registry-photon v2.6.2-v1.6.2 62c30cdb384a 2 weeks ago 196MBgoharbor/nginx-photon v1.6.2 C0602500e829 2 weeks ago 132MBgoharbor/harbor-log v1.6.2 781ee4ceb5d3 2 weeks ago 197MBgoharbor/harbor-jobservice v1.6.2 3419a2276f96 2 weeks ago 192MBgoharbor/harbor-ui v1.6.2 66268686bb96 2 weeks ago 215MBgoharbor/harbor-adminserver v1.6.2 4024440925a4 2 weeks ago 181MBgoharbor/harbor-db v1.6.2 0ed4186be0d1 2 weeks ago 219MB
Started container
[root@localhost harbor] # docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES18c82d20d070 goharbor/harbor-jobservice:v1.6.2 "/ harbor/start .sh "2 minutes ago Up About a minute harbor-jobservice1a807ff9307d goharbor/nginx-photon:v1.6.2" nginx- g 'daemon of... " 2 minutes ago Up About a minute (health: starting) 0.0.0.0 443/tcp 4443-> 443/tcp, 0.0.0.0 starting 4443-> 4443/tcp 0.0.0.0 80/tcp nginx83428db239b3 goharbor/harbor-ui:v1.6.2 5000-> 80/tcp nginx83428db239b3 goharbor/harbor-ui:v1.6.2 "/ harbor/start.sh" 2 minutes ago Up 23 seconds (health: starting) harbor-uid785d1e0b4fb goharbor/redis-photon:v1.6.2 "docker-entrypoint.s …" 2 minutes ago Up 2 minutes 6379/tcp redis126657d6e33c goharbor/harbor-adminserver:v1.6.2 "/ harbor/start.sh" 2 minutes ago Restarting (1) 3 seconds ago Harbor-adminserver1ac23c837879 goharbor/registry-photon:v2.6.2-v1.6.2 "/ entrypoint.sh / etc..." 2 minutes ago Up 2 minutes (healthy) 5000/tcp registryd080851c8190 goharbor/harbor-db:v1.6.2 "/ entrypoint.sh post …" 2 minutes ago Up 2 minutes (healthy) 5432/tcp harbor-dbb47254ceba04 goharbor/harbor-log:v1.6.2 "/ bin/sh-c / usr/loc …" 2 minutes ago Up 2 minutes (healthy) 127.0.0.1 healthy 1514-> 10514/tcp harbor-log
By default, docker does not allow you to access HARBOR directly from an IP address, but you can access it by using curl naming in host
The solution to this problem is:
You need to add a whitelist to the docker security check
# vim / usr/lib/systemd/system/docker.service # modify the following line ExecStart=/usr/bin/dockerd-insecure-registry=192.168.88.30:5000
Revisit
After logging in with the system administrator account, you can see that there is a default public project
4. Push image to harbor
Next, we push the springboot-docker image done in the article on building a simple springboot application image in docker-dockerfile to harbor.
First, create a test-project project in harbor
If the access level is set to publish, everyone can pull and push the image without logging in.
Log in to harbor on the command line
Docker login 192.168.88.30:5000
The following problems have occurred
Error response from daemon: Get https://192.168.88.30:5000/v2/: http: server gave HTTP response to HTTPS client
You need to add a whitelist to the docker security check
# vim / usr/lib/systemd/system/docker.service # modify the following line ExecStart=/usr/bin/dockerd-insecure-registry=192.168.88.30:5000
Restart docker
Systemctl daemon-reloadsystemctl restart docker.service
Log in again
[root@localhost harbor] # docker login 192.168.88.30:5000Username: adminPassword: Login Succeeded
Check our current mirror image.
[root@localhost springboot-docker] # docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEspringboot-docker 1.0 3be343b3b3ea About a minute ago 121MB
The naming format of the warehouse pull or push:
${IP or domain} / ${project} / ${module}: ${tag}
The original springboot-docker project is tagged and pushed to harbor.
[root@localhost ~] # docker tag springboot-docker:1.0 192.168.88.30:5000/test-project/springboot-docker:1.0 [root@localhost ~] # docker imagesREPOSITORY TAG IMAGE ID CREATED SIZE192.168.88.30:5000/test-project/springboot-docker 1.0 3be343b3b3ea 10 hours ago 121MBspringboot-docker 1.0 3be343b3b3ea 10 hours ago 121MB [root@localhost ~] # docker push 192.168.88.30:5000/test-project/springboot-docker:1.0The push refers to repository [192.168.88.30:5000/test-project/springboot-docker] fff182a7c29a: Pushed f7b41bda6817: Pushed ed6f0bd39121: Pushed 0c3170905795: Pushed df64d3292fd6: Pushed 1.0: digest: sha256:f37dc7dbb294a3e1eb7f53d8ad7616068dccf7996233bc8b72578d96aabee1fa size: 1366
After the push is completed, you can see the corresponding image on the page.
Pull the image from the private database:
Docker pull 192.168.88.30:5000/test-project/springboot-docker:1.0 above is what Xiaobian shared with you about how to install enterprise docker image repository Harbor. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.