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

Vue implements the countdown component for second kills

This article shares the specific code of Vue to i...

Explanation of factors affecting database performance in MySQL

A story about database performance During the int...

Summary of Docker configuration container location and tips

Tips for using Docker 1. Clean up all stopped doc...

Summary of front-end knowledge in the Gokudō game

background In the early stages of learning Japane...

Tutorial on how to connect and use MySQL 8.0 in IDEA's Maven project

First, let's take a look at my basic developm...

Docker data management and network communication usage

You can install Docker and perform simple operati...

MySQL service and database management

Table of contents 1. Start and stop service instr...

How to install PostgreSQL and PostGIS using yum on CentOS7

1. Update the yum source The PostgreSQL version o...

How to load Flash in HTML (2 implementation methods)

First method : CSS code: Copy code The code is as ...

MySQL 8.0 WITH query details

Table of contents Learning about WITH queries in ...

Some notes on modifying the innodb_data_file_path parameter of MySQL

Preface innodb_data_file_path is used to specify ...

Detailed explanation of pure SQL statement method based on JPQL

JPQL stands for Java Persistence Query Language. ...

MySQL 5.5.56 installation-free version configuration method

The configuration method of MySQL 5.5.56 free ins...

Share the pitfalls of MySQL's current_timestamp and their solutions

Table of contents MySQL's current_timestamp p...

HTML tags explained

HTML tags explained 1. HTML tags Tag: !DOCTYPE De...