Build a Docker registry private image to resolve the Docker private warehouse push error
applies To: Docker 1.8 Environment: Centos7
Each version of the Docker modification configuration content is different, please be optimistic about the installation of the Docker version.
1) Download Docker Registry private image
# Docker Pull Docker.io/registry
2) Modify the configuration file
# Gedit/etc/sysconfig/docker
Options= '--selinux-enabled--insecure-registry 192.168.137.17:5000 '
Note: The red IP is the modified part
3) Start the registry from the container
# Docker run-d-P 5000:5000--name registry-v/home/dockeruser/data:/tmp/registry docker.io/registry
Note:-D indicates that the container is running in the background
-P maps the host's 5000 port to the container's 5000 port
--name name the container named registry
-V means to change the storage location of the mirror "/tmp/registry" to "/home/dockeruser/data" of the host
Note: This step must be after step 2), otherwise modifying the configuration file will not take effect
4) before uploading to a private registry, you need to specify a new registry destination address, which needs to be preceded by the image name
Prefix of host name and port.
#docker Images Node/helloworld
Get 22d56cbd9e6
#docker tag 22d56cbd9e6 192.168.137.17:5000/node/helloworld
Note: 192.168.137.17:5000 is the IP address and port of the host
5) Upload the tagged image to the private library
# Docker Push 192.168.137.17:5000/node/helloworld
The following information is displayed:
The push refers to a repository [192.168.137.17:5000/node/helloworld] (Len:1)
Sending image list
Pushing repository 192.168.137.17:5000/node/helloworld (1 tags)
D8bd0657b25f:image successfully pushed
A582cd499e0f:image successfully pushed
3c3e582d88fa:image successfully pushed
625e77fff1a8:image successfully pushed
A00e4cef421d:image successfully pushed
F543704611ec:image successfully pushed
C32f3278cf8f:image successfully pushed
5c88f029bcb1:image successfully pushed
D3533bde148f:image successfully pushed
6a06ae308acc:image successfully pushed
9d1508e155f4:image successfully pushed
F3c0db6d5143:image successfully pushed
Df45579dbc81:image successfully pushed
Pushing tag for Rev. [Df45579dbc81] On
{Http://192.168.137.17:5000/v1/repositories/node/helloworld/tags/latest}
Problems encountered:
The push refers to a repository [192.168.137.17:5000/node/helloworld] (Len:1)
Unable to ping registry endpoint https://192.168.137.17:5000/v0/
V2 Ping attempt failed with Error:get https://192.168.137.17:5000/v2/: Dial TCP 192.168.137.17:5000:connection refused
V1 Ping attempt failed with error:get https://192.168.137.17:5000/v1/_ping:dial TCP 192.168.137.17:5000:connection refu Sed
Solution:
# Gedit/etc/sysconfig/docker
Options= '--selinux-enabled--insecure-registry 192.168.137.17:5000 '
Note: This step must be "Step 2" before creating the container for the private warehouse, otherwise the modification configuration file will not take effect the slot: All the answers on the web do not indicate which version of Docker it is. Each version of the Docker modification configuration content is different.