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