Docker:vmware Enterprise-Class Docker mirror--harbor construction

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.10.10 (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.1

Ubuntu: (sudo vi/etc/default/docker)

docker_opts= "--insecure-registry 10.10.10.10"

4.2 Centos:

Modify the/usr/lib/systemd/system/docker.service file

Modify a row Execstart=/usr/bin/docker daemon-h fd://--registry-mirror=https://docker.mirrors.ustc.edu.cn-- Insecure-registry 10.10.10.10 "

Why would you want to modify this configuration file? --insecure-registry represents the local mirror library, which requires a restart of the Docker service when the above configuration file is modified, when Docker login connects to the specified local mirror library.

If you do not modify this configuration file, the following error will be thrown when you log on to the mirror (Docker login 10.10.10.10 ")

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

5. Restart Docker Service

Service Docker restart

7. Build and start
Docker-compose up-d
8. Download the Hello-world image from the Docker hub
Docker Run Hello-world
9. 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
10. 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
11, in the browser access to 10.10.20.202, user name: admin, Password: Harbor12345 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

"Start Harbor"

$ 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:

"Delete Harbor"

$ 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-rf/data/database
$ rm-rf/data/registry

Docker:vmware Enterprise-Class Docker mirror--harbor construction

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.