Now that Docker Registry has been upgraded to V2, the latest version of Docker no longer supports V1. Registry v2 uses the Go language to make a lot of optimizations in terms of performance and security, and re-engineered the image storage format. This document is written on the basis of V1, if you need to install Registry v2, just download registry:2.2, or you can download the following installation script to run the installation.
First, download registry image
Docker Pull Registry
Second, start the Private warehouse container, by default, the warehouse will be stored in the container in the/tmp/registry directory, so if the container is deleted, then the image stored in the container will be lost, so we typically specify a local directory attached to the/tmp/registry in the container
Docker run-d-P 5000:5000-v/data/docker/registry:/tmp/registry Registry
Third, view the startup process
Docker Ps-a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9dc25301d44f registry "Docker-registry" seconds ago up seconds 0.0.0.0:5000->5000/ TCP Reverent_ptolemy
Iv. Create a mirrored link or label a base image
Docker tag Docker.io/centos6.7-base 10.44.86.222:5000/centos6.7-base
V. submit the image to a local private warehouse
Docker Push 10.44.86.222:5000/centos6.7-base
Vi. If you report the following error, you need to modify the/etc/sysconfig/docker file
Error response from Daemon:invalid registry endpoint https://10.44.86.222:5000/v0/: Unable to ping registry endpoint HTTP s://10.44.86.222:5000/v0/
V2 Ping attempt failed with Error:get https://10.44.86.222:5000/v2/: EOF
V1 Ping attempt failed with Error:get Https://10.44.86.222:5000/v1/_ping:EOF. If This private registry supports only the HTTP or HTTPS with a unknown CA certificate, please add '--insecure-registry 10.44 .86.222:5000 ' to the daemon ' s arguments. In the case of HTTPS, if you have access to the Registry's CA certificate, no need for the flag; Simply place the CA certificate AT/ETC/DOCKER/CERTS.D/10.44.86.222:5000/CA.CRT
Add the following options to the/etc/sysconfig/docker file:
other_args= '--insecure-registry 10.44.86.222:5000 '
Options= '--selinux-enabled--insecure-registry 10.44.86.222:5000 '
Because the default Docker registry is using HTTPS from the docker1.3.2 version
Vii. See if a private warehouse has a corresponding mirror
Curl 10.44.86.222:5000/v1/search
{"Num_results": 1, "Query": "", "results": [{"description": "", "Name": "Library/centos6.7-base"}]}
This article is from the "My Ops Time" blog, so be sure to keep this source http://aaronsa.blog.51cto.com/5157083/1740747
Build Docker private Warehouse under CentOS