Detailed explanation of the construction and use of docker private warehouse

Detailed explanation of the construction and use of docker private warehouse

1. Download the repository image

docker pull registry

2. Create a private warehouse container -d means background start

docker run -d -p 5000:5000 -v /opt/data/registry:/var/lib/registry registry 

3. Remove the 5000 port restriction from the firewall

firewall-cmd --zone=public --add-port=5000/tcp --permanent

4. Verify whether the private warehouse is started successfully

http://192.3.8.12:5000/v2

5. Packaging image

docker tag my-nginx:v1 192.168.56.200:5000/centos

6. Upload the packaged image to a private warehouse

[root@server1 ~]# docker push 192.168.56.200:5000/centos
The push refers to a repository [192.168.56.200:5000/centos]
Get https://192.168.56.200:5000/v1/_ping: http: server gave HTTP response to HTTPS client 

This problem may be caused by the client using https, but the docker registry does not use https service. One way to handle this is to change the client's request to the address "192.168.56.200:5000" to http.

Solution:

In the "/etc/docker/" directory, create the "daemon.json" file. Write in the file: { "insecure-registries":["192.168.56.200:5000"] }

After saving and exiting, restart Docker.

7. The problem occurred again when uploading again, because selinux was not turned off. (Use the setenforce 0 command to temporarily disable it, or you can run vi /etc/sysconfig/selinux and change the line inside to SELINUX=disabled, save the change, and then reboot.)

8. View the image in the private warehouse
http://192.3.8.187:5000/v2/_catalog

9. In this way, the image of the private warehouse is downloaded on server2.

docker pull 192.168.56.200:5000/centos 

10. Backup and restore of warehouse images.

Directly back up /opt/data/registry regularly, and restore it by directly hanging it under the docker-registry image and starting it.

docker run -d -p 5000:5000 -v /opt/data/registry:/var/lib/registry registry

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Steps to build a docker private repository from scratch
  • Docker builds a private warehouse (registry, harbor)
  • Detailed explanation of Ubuntu Docker Registry to build a private warehouse
  • Detailed explanation of the construction and verification of Docker private warehouse Registry
  • How to build a Docker private warehouse in Centos 7
  • Detailed explanation of the easiest way to build a Docker private warehouse
  • Detailed steps for Docker to build a local private warehouse
  • Detailed explanation of CentOS 7: Docker private warehouse construction and use
  • How to build a private warehouse with docker (ubuntu 14.04, Docker version 1.6.4)
  • Detailed steps to build a Docker Registry private warehouse

<<:  Super simple qps statistics method (recommended)

>>:  Vue commonly used high-order functions and comprehensive examples

Recommend

jQuery implements the drop-down box for selecting the place of residence

The specific code for using jQuery to implement t...

How to enter and exit the Docker container

1 Start the Docker service First you need to know...

Control the vertical center of the text in the HTML text box through CSS

When the height attribute of Text is defined, the ...

Two ways to clear float in HTML

1. Clear floating method 1 Set the height of the ...

A brief discussion on how to choose and combine div and table

Page layout has always been my concern since I st...

Solve the problem of case sensitivity of Linux+Apache server URL

I encountered a problem today. When entering the ...

10 key differences between HTML5 and HTML4

HTML5 is the next version of the HTML standard. M...

Solution to uninstalling Python and yum in CentOs system

Background of the accident: A few days ago, due t...

Summary of Mysql-connector-java driver version issues

Mysql-connector-java driver version problem Since...

How to use bind to set up DNS server

DNS (Domain Name Server) is a server that convert...

Analyze how a SQL query statement is executed in MySQL

Table of contents 1. Overview of MySQL Logical Ar...

Detailed explanation of mysql transaction management operations

This article describes the MySQL transaction mana...

JavaScript to switch multiple pictures

This article shares the specific code of JavaScri...

How to modify the group to which a user belongs in Linux

Modify the group to which a user belongs in Linux...