Docker Registry Docker learning

Foreword

As already learned how to build our own image through Dockerfile, but a system may contain a number of services that is a lot of micro-mirrors, as more and more of a mirror when you have to have a place to manage these mirrors , Docker Docker Hub to the official maintenance and management of all images, only for free users can only create a private warehouse, only to paid subscribers have more privileges private warehouse, for which the Docker Registry official open source code, we can build a proprietary image registration center within the LAN through it.

Use public registry

Docker Hub is a mirror of public registry maintained by the official Docker, users can push their image to Docker Hub free warehouse, in order to use Docker Hub must first register a Docker Hub account.
Account registration address: HTTPS: // Hub. docker.com/ ( Note that to be successful you must first register an account FQ)


Command after a successful registration can enter the account password by docker login log into creating our own private warehouses and push the mirror.

Set up local registration center

Usually due to security reasons and the network, will set up a mirrored internal registry on the local LAN.
1. Run the docker pull command to pull registry mirror.



2. Start a registry container through the mirror.

Original Address: https: //www.jianshu.com/p/fef890c4d1c2

3. Check the operation of the vessel.

4. Start your browser to the container 192.168.56.101:5000/v2/ following occurs then the normal operation.

Then we use the docker push command to push their image to the local registry.
Push process may not succeed that is below this happens getsocket: connection refused.



Try the following solutions:
modify file /etc/docker/daemon.json
vi /etc/docker/daemon.json

增加"insecure-registries": ["192.168.56.101:5000"]



Then restart the engine docker

service docker restart

Push the mirror again to the registry, we will find that the push was successful.



after a successful push to look at just push up the mirror, point your browser to:



Also you can use the following command to verify that the push was successful:

This will build a good Docker private warehouse, and now you can pull the image from the local Registry by docker pull.

Guess you like

Origin www.cnblogs.com/jpfss/p/10948182.html