1. About Docker Registry
Official website Docker hub
RegistryInGitHubThere are two code: the old code base and the new code base. The old code is usedPythonWritten, existPull and push performance issues, out to 0.9.1 deprecated2.0 version started to be developed in the new code base, and the new code base was implemented in go language, modified the mirror id registry pullpush mirror efficiency.
2. Registry Deployment
Run a command to get registry, currently the latest version is 2.3.1
Docker Pull registry:2.3. 1
Start a container
Docker run-d-v/opt/registry:/var:--restart=always --name Registry registry: 2.3. 1
The Registry Service will save the uploaded image in the container's /var/lib/registry by default, and we will mount the host's /opt/registry directory to this directory to save the image to the host / the Opt/registry directory.
Run Docker PS and look at the container case
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS names2355477e3c21 registry:2.3. 1 "/bin/registry/etc/d" 3 hours ago 3 Hours 0.0. 0.0:/tcp Registry
Instructions we have started the registry service, open the browser input http://127.0.0.1:5000/v2, the following situation shows that registry is working properly
3. Verify that the registryimage push to the local image library, we will flag the image as being pushed to the private warehouse via Docker tag
Docker Tag registry:2.3. 1 127.0. 0.1:/registry:2.3. 1
Then look at the following local mirrors, using the instructions
Docker images
REPOSITORY TAG IMAGE ID CREATED SIZE127.0. 0.1:/registry 2.3. 1 60e8332136e4 3 months ago 224.5 mbregistry 2.3 . 1 60e8332136e4 3 months ago 224.5 MB
Push the mirror to the local mirror library
127.0.0.1:5000/registry:2.3.1
Construction verification of Docker private warehouse registry