Implementation of Docker private library

Implementation of Docker private library

Installing and deploying a private Docker Registry is one of the necessary steps to introduce, learn, and use Docker technology. Especially when Docker is accepted by the organization and more people, projects and products begin to use Docker, storing and distributing self-made Docker images becomes a necessity. Docker Registry has inherited the characteristics of "Docker has many pitfalls" as always. For this reason, I will record the steps and problems encountered in the process of building "various" Registries for my own reference and reference.

Registry2 not only supports local disks for image storage, but also supports many mainstream third-party storage solutions. Through the distributed storage system, you can also implement a distributed Docker Registry service.

Prepare

server1, server2 (server1 is used as a private library server, and server2 is used as a common client)

On server1

1 Download the registry

docker pull registry:latest

2 Configure /etc/default/docker Because https requires certificate passwords and other complexities, just add insecure-registry

# Docker Upstart and SysVinit configuration file

# Customize location of Docker binary (especially for development testing).
#DOCKER="/usr/local/bin/docker"

# Use DOCKER_OPTS to modify the daemon startup options.
#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
DOCKER_OPTS="--insecure-registry 127.0.0.1:5000"
# If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/"

# This is also a handy place to tweak where Docker's temporary files go.
#export TMPDIR="/mnt/bigdrive/docker-tmp"

3 Start the registry

sudo docker run --name registry -d -p 5000:5000 -v /home/docker_registry:/var/lib/registry --restart=always registry:latest

4 tag mirror

docker tag redis server1:5000/redis

5 Push and save private images

docker push server1:5000/redis

5.1 View images pushed to private repositories

$ docker search 10.10.105.71:5000/tonybai/busybox/
Error response from daemon: Unexpected status code 404
But with the v2 version of the API, we can achieve the same purpose:

$curl http://10.10.105.71:5000/v2/_catalog
{"repositories":["tonybai/busybox"]}

On server2 (client)

Because Docker Registry mentions that if the insecure registry mode is used, the Docker Daemon on all hosts that interact with the Registry must be configured with the –insecure-registry option. In addition to this mode, you can also configure certificates, which will not be explained here.

1 Configure-insecure-registry (centos:/etc/sysconfig/docker ubuntu:/etc/default/docker)

# Docker Upstart and SysVinit configuration file

# Customize location of Docker binary (especially for development testing).
#DOCKER="/usr/local/bin/docker"

# Use DOCKER_OPTS to modify the daemon startup options.
#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
DOCKER_OPTS="--insecure-registry server1:5000"
# If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/"

# This is also a handy place to tweak where Docker's temporary files go.
#export TMPDIR="/mnt/bigdrive/docker-tmp"

2 Downloads

docker pull server1:5000/redis

3 Submit push

docker tag redis server1:5000/redis
docker push server1:5000/redis

refer to:
http://www.cnblogs.com/xcloudbiz/articles/5526262.html

This is the end of this article about the construction and implementation of docker private library. For more relevant content about docker private library construction, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Implementation of Docker to build private warehouse (registry and Harbor)
  • How to implement Docker Registry to build a private image warehouse
  • Docker builds a private warehouse (registry, harbor)
  • How to build a private docker registry
  • Detailed explanation of the construction and verification of Docker private warehouse Registry
  • Detailed steps to build a Docker Registry private warehouse
  • Tutorial on setting up a private Docker registry

<<:  Detailed explanation of slots in Vue

>>:  MySQL stored procedure in, out and inout parameter examples and summary

Recommend

nginx automatically generates configuration files in docker container

When a company builds Docker automated deployment...

CSS delivery address parallelogram line style example code

The code looks like this: // Line style of the pa...

How to set up a deployment project under Linux system

1. Modify the firewall settings and open the corr...

Detailed tutorial on installing CentOS, JDK and Hadoop on VirtualBox

Table of contents 1. Prerequisites 1.1 Supported ...

Research on the effect of page sidebar realized by JS

Table of contents Discover: Application of displa...

4 ways to view processes in LINUX (summary)

A process is a program code that runs in the CPU ...

The concept of MySQL tablespace fragmentation and solutions to related problems

Table of contents background What is tablespace f...

How to install redis in docker and set password and connect

Redis is a distributed cache service. Caching is ...

WebStorm cannot correctly identify the solution of Vue3 combined API

1 Problem Description Vue3's combined API can...

Detailed explanation of XML syntax

1. Documentation Rules 1. Case sensitive. 2. The a...

Go to another file after submitting the form

<br />Question: How to write in HTML to jump...

Detailed explanation of the entry-level use of MySql stored procedure parameters

Use of stored procedure in parameters IN paramete...

Details on using bimface in vue

Table of contents 1. Install Vue scaffolding 2. C...