Docker: Centos7 install Docker hub Harbor, visualize registry

Source: Internet
Author: User
Tags docker hub docker registry
This is a creation in Article, where the information may have evolved or changed.


1,harbor



The development and operation of container applications requires reliable image management. In terms of security and efficiency, it is necessary to deploy registry within a private environment. Project Harbor is a registry server open source project designed by the VMware company China Team for enterprise users, including Rights Management (RBAC), LDAP, auditing, management interface, self-registration, HA and other enterprise-required functions, while targeting the characteristics of Chinese users, Design image copy and Chinese support features, welcome to use and feedback.
It's also a VMware Open source project. But the interface is a bit too-fashioned.



2, download and install



Project Address:
Https://github.com/vmware/harbor
This article is written with Golang do not know why download need such a large file, 303MB, directly to the Docker image included.
Https://github.com/vmware/harbor/releases
Please download it using the downloader, otherwise the middle is broken to cry to die. or download it when you're off duty.
Throw it on top of the CENTOS7.


tar -zxvf harbor-offline-installer-0.5.0.tgz
cd harbor
#vi / etc / hosts
10.0.2.15 reg.freewebsys.com
Set an ip and modify vi harbor.cfg
To successfully install also requires the docker registry.
https://c.163.com/hub#/m/repository/version/?repoId=3099
It can be downloaded from the domestic mirror. It is really hard to be an IT company in China. It seems that the mirror image of 163 should be reliable.

docker pull hub.c.163.com/library/registry:latest
#Download the registry above daocloud, then change the tag to be recognized by the harbor installation script.
docker tag daocloud.io/library/registry:latest library / registry: 2.5.0
daocloud.io/library/registry latest d1e32b95d8e8 7 weeks ago 33.17 MB
library / registry 2.5.0 d1e32b95d8e8 7 weeks ago 33.17 MB
Also install docker-compose

Set directory permissions, otherwise there is a problem with docker startup:

** If any of them is not configured, a docker container won't start.
Causes a chain reaction, causing problems with harbor startup. **
Also make sure that the machine is not started nginx, mysql service or port is not occupied.

chcon -Rt svirt_sandbox_file_t ./common/ harbor.cfg prepare
chcon -Rt svirt_sandbox_file_t / data / registry
chcon -Rt svirt_sandbox_file_t / var / log / harbor
chcon -Rt svirt_sandbox_file_t / data / database
chcon -Rt svirt_sandbox_file_t / data / job_logs
A lot of services together. very messy.

[Step 4]: starting Harbor ...
Creating network "harbor_default" with the default driver
Creating harbor-log
Creating harbor-db
Creating registry
Creating harbor-ui
Creating harbor-jobservice
Creating nginx

✔ ---- Harbor has been installed and started successfully .----

Now you should be able to visit the admin portal at http://reg.freewebsys.com.
For more details, please visit https://github.com/vmware/harbor.
The startup can be accessed through the web page.

3. Login interface
The default password is Harbor12345, and the account number is admin.

Looking at the hub project, it is still empty.
4, login upload
Because it was bound to a 10.0.2.15 ip, but encountered.
Login with admin

docker login 127.0.0.1 #can login
docker login 10.0.2.15 #Cannot log in
Modify the configuration: vi / etc / sysconfig / docker

INSECURE_REGISTRY = '-insecure-registry 10.0.2.15'
Enable insecure login method, you can use admin login.
This bug is already on git.
https://github.com/vmware/harbor/issues/811

Then upload the docker image:

# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hub.c.163.com/library/registry latest d1e32b95d8e8 7 weeks ago 33.17 MB
library / registry 2.5.0 d1e32b95d8e8 7 weeks ago 33.17 MB
vmware / harbor-log 0.5.0 8a0833f24c8f 3 months ago 190.5 MB
vmware / harbor-jobservice 0.5.0 f8d65542009e 3 months ago 169.4 MB
vmware / harbor-ui 0.5.0 587e09accc1b 3 months ago 233 MB
vmware / harbor-db 0.5.0 e4339a680042 3 months ago 326.8 MB
nginx 1.11.5 05a60462f8ba 4 months ago 181.4 MB
registry 2.5.0 c6c14b3960bd 7 months ago 33.28 MB
photon 1.0 e6e4e4a2ba1b 8 months ago 127.5 MB
#Use tag to tag the image again, and then push it on it.
# docker tag hub.c.163.com/library/registry:latest 10.0.2.15/library/registry:latest
# docker push 10.0.2.15/library/registry:latest
Then you can see the uploaded image in the public project.
4. Summary
The original link to this article is: http://blog.csdn.net/freewebsys/article/details/60978021 Reprinting without permission of the blogger is prohibited.
The blogger address is: http://blog.csdn.net/freewebsys

harbor is a docker visual interface that can browse to the docker image on the docker registry.
Very convenient, but it is more troublesome to set up, and also ran nginx, mysql.
Tossing tossing and running. Still very simple.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.