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

Example of using #include file in html

There are two files a.htm and b.htm. In the same d...

How to handle forgotten passwords in Windows Server 2008 R2

What to do if you forget Windows Server 2008R2 So...

How to split data in MySQL table and database

Table of contents 1. Vertical (longitudinal) slic...

MySQL uses binlog logs to implement data recovery

MySQL binlog is a very important log in MySQL log...

React handwriting tab switching problem

Parent File import React, { useState } from '...

Chrome monitors cookie changes and assigns values

The following code introduces Chrome's monito...

How to determine if the Linux system is installed on VMware

How to determine whether the current Linux system...

Build a high-availability MySQL cluster with dual VIP

Table of contents 1. Project Description: 2. Proj...

JavaScript code to achieve a simple calendar effect

This article shares the specific code for JavaScr...

Problems encountered when uploading images using axios in Vue

Table of contents What is FormData? A practical e...

Summary of 3 minor errors encountered during MySQL 8.0 installation

Preface In the past, the company used the 5.7 ser...