Docker articles (two) image management - Mirror warehouse

I. Introduction

When we make good his own image, in order to use this image on another server, we need to mirror push (push) to the repository (Repository), then pull on another server (pull) the image. Warehouse partakers of public warehouses and private warehouses, if you want to use Docker in the company, basically we are unlikely to upload image will commercial projects to the public warehouse, so private warehouse will come into play, it can avoid business exposed to the risk of the project.

Provide warehousing services mainly in three ways:

  • Docker Hub - a warehouse Docker official maintained, by default only public warehouse, private warehouse is charging, the minimum is $ 700 / month offers five private warehouse
  • Registry Mirror -  Docker official mirror , this mirror contains an implementation of Docker Registry HTTP API V2 is applied to Docker 1.6 and 1.6 or later
  • Harbor - VMware's enterprise-class Open Source Project Registry

Two, Register mirror

Register by mirroring to build a private warehouse, using 2 servers to demonstrate, as a warehouse, as a client

2.1 192.168.6.92 server

Mirror Pull

docker pull registry

Run container

docker run -p 80:5000 -itd --name hub registry

2.2 192.168.6.91 server

Since the server is not running on 192.168.6.92 HTTPS protocol, push the mirror will appear the following prompts to 92 servers:

Get https://192.168.6.92:80/v2/: http: server gave HTTP response to HTTPS client

So you need to modify /lib/systemd/system/docker.service 91 file servers, increase the startup parameters --insecure-registry = 192.168.6.92: 80

ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
改为
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --insecure-registry=192.168.6.92:80

Then restart the service Docker

systemctl daemon-reload
systemctl restart docker

Now the "Docker articles (a) to mirror -Tomcat open APR mode" Mirror article created pushed to the server

#格式 <registry_ip>:<registry_port>/<image_name>:<image_tag>
docker tag anron 192.168.6.92:80/anron:v1.0
docker push 192.168.6.92:80/anron:v1.0

View mirror if successful push

[root@docker1 imagebuilder]# curl http://192.168.6.92:80/v2/_catalog
{"repositories":["anron"]}
[root@docker1 imagebuilder]# curl http://192.168.6.92:80/v2/anron/tags/list
{"name":"anron","tags":["v1.0"]}

After a successful push by the following command in the other server can pull the mirror

docker pull 192.168.6.92:80/anron:v1.0

Three, Harbor

Harbor is a mirror for the storage and distribution of enterprise-class Docker Registry service, is VMware's enterprise-class open source projects Registry, based on the development of Docker Registry, which in addition to providing a friendly Web management interface, user roles and rights management, user actions audit outside mirror copy features such as multiple Registry nodes, it can integrate K8s plug (when managing large numbers of servers, manually enter up commands to manage large number of containers in each server is unrealistic, K8s provide more advanced and more flexible management style).
 

Released five original articles · won praise 0 · Views 145

Guess you like

Origin blog.csdn.net/anron/article/details/104844874