Docker builds a private warehouse

Source: Internet
Author: User

1. Download the warehouse image.

Docker Pull registry//is primarily used to build private warehouses.

2, the host port is mapped to the container, the container port 5000 cannot be changed.

Docker run-d-P 5000:5000 Registry//Start container in registry mirror, listen on port 5000

3, go to the private warehouse container.

Docker exec-it 796 (container ID)/bin/sh//Here is SH not bash because here is no soft connection.

NETSTAT-LNP See if Port 5000 is turned on.

4 to see if you can access the private warehouse.

Curl-i 127.0.0.1:5000 Status code is not 200

5, upload the private image to the private repository.

The experiment is convenient, we download 1 smaller images, Buysbox, and in addition before uploading

You need to make a tag for the image, indicating that the IP and port are

Docker tag BusyBox native IP: Port/busybox

The upload process has an error:

The reason for this is that Docker, since 1.3.X, interacts with the Docker registry by default with HTTPS, but the private repository built here only provides HTTP services, so when interacting with a private repository there is an error, To resolve this issue, you need to increase the startup parameters to use HTTP access by default when you start the Docker server, and the workaround is

# Vim/etc/init.d/docker

Change $exec-d $other _args to $exec-d--insecure-registry 192.168.2.227:5000 $other _args

Restarting the Docker service

#/etc/init.d/docker Restart

To start the container:

# Docker start registry_container_id//Here to remember to start the container

Upload again:

# Docker Push 192.68.2.227:5000/busybox

View all mirrors in a private warehouse

# Curl 192.168.2.227:5000/v2/_catalog

Here we can see the image we just uploaded.

If you download the image:

Docker Push 192.168.2.227:5000/busybox

Refer to the Brother Bao blog, link as follows:

Http://www.cnblogs.com/fansik/p/5530802.html

Docker builds a private warehouse

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.