Harbor Construction (VMware Enterprise Docker Mirror)

Source: Internet
Author: User
Tags docker hub docker run

1, download harbor, address Https://github.com/vmware/harbor
2, enter the Harbor-master/deploy directory, modify the Harbor.cfg file, mainly modify the following information
2.1, hostname =10.10.20.202 (This is the IP of Harbor server, can not write 127.0.0.1)
2.2, modify the mailbox related information

3. Execute the./prepare command
4, modify the/usr/lib/systemd/system/docker.service file, add--insecure-registry 10.10.20.202

#修改前
#ExecStart =/usr/bin/docker daemon-h fd://

#修改后
Execstart=/usr/bin/docker Daemon--insecure-registry 10.10.20.202-h fd://

If you do not modify this profile, the following error will be thrown when you log on to the mirror (Docker login 10.10.20.202)

Error response from Daemon:get https://10.10.20.202/v1/users/: Dial TCP 10.10.20.202:443:getsockopt:connection refused

5. Build and start
Docker-compose up-d
6. Download the Hello-world image from the Docker hub
Docker Run Hello-world
7. Label the image so that it can be uploaded to the harbor, where the library is the default item provided by the
Docker tag Hello-world 10.10.20.202/library/hello-world
8. Upload Image
To log in, execute the following instructions, and then enter the user name and password
Docker Login 10.10.20.202
Upload image
Docker Push 10.10.20.202/library/hello-world
9, in the browser access to 10.10.20.202, login completed, click the Library this project, you can see the uploaded Hello-world

The following start and stop commands are included with Harbor

Build and start Harbor:

$ sudo docker-compose up-d
Creating harbor_log_1
Creating Harbor_mysql_1
Creating harbor_registry_1
Creating harbor_ui_1
Creating harbor_proxy_1
Stop Harbor:

$ sudo docker-compose stop
Stopping harbor_proxy_1 ... done
Stopping harbor_ui_1 ... done
Stopping harbor_registry_1 ... done
Stopping harbor_mysql_1 ... done
Stopping harbor_log_1 ... done
Restart Harbor after stopping

$ sudo docker-compose start
Starting harbor_log_1
Starting Harbor_mysql_1
Starting Harbor_registry_1
Starting Harbor_ui_1
Starting Harbor_proxy_1
Remove Harbor ' s containers while keeping the image data and Harbor's database files on the file system:

$ sudo docker-compose rm
Going to remove Harbor_proxy_1, Harbor_ui_1, Harbor_registry_1, Harbor_mysql_1, harbor_log_1
Is you sure? [YN] Y
Removing harbor_proxy_1 ... done
Removing harbor_ui_1 ... done
Removing harbor_registry_1 ... done
Removing harbor_mysql_1 ... done
Remove Harbor ' s database and image data (for a clean re-installation):

$ rm-r/data/database
$ rm-r/data/registry

Harbor Construction (VMware Enterprise Docker Mirror)

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.