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: 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:
|
<<: Detailed explanation of slots in Vue
>>: MySQL stored procedure in, out and inout parameter examples and summary
When a company builds Docker automated deployment...
The code looks like this: // Line style of the pa...
When applying docker containers, we often mount t...
1. Modify the firewall settings and open the corr...
If there is an <input type="image">...
Table of contents 1. Prerequisites 1.1 Supported ...
Table of contents Discover: Application of displa...
A process is a program code that runs in the CPU ...
Table of contents background What is tablespace f...
Redis is a distributed cache service. Caching is ...
1 Problem Description Vue3's combined API can...
1. Documentation Rules 1. Case sensitive. 2. The a...
<br />Question: How to write in HTML to jump...
Use of stored procedure in parameters IN paramete...
Table of contents 1. Install Vue scaffolding 2. C...