Experimental environment: Two centos7 virtual machines, one is server, used as the client, and the other is registry, used as the docker private image repository.Basic Configuration
Check the IP addresses of the two VMS.The IP address of the server is192.168.134.151.
The IP address of the Registry is192.168.134.150.
Us
Preface
Under normal circumstances, if our computer in a networked environment, we can directly through the Docker pull images to obtain the relevant image, of course, this must be a networked environment, depending on the user's network speed or the size of the image has a different wait, If we were able to build a mirror repository like remote networking locally, and put our usual images in our own managed repositories, wouldn't it be possible to qu
1, actual combat purposes
build an enterprise-private mirrored warehouse that meets push and pull mirroring from the development environment . When we use k8s to orchestrate and dispatch containers, the basic unit of the operation is mirroring, so we need to pull the mirror from the repository to the current working node. The use of a public Docker hub is perfectly suited to our needs and is very c
configuration file# Customize location of the 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 "# If you need Docker-to-use a HTTP proxy, it can also be specified here.export http_pr
: This article mainly introduces Docker: building a private repository. if you are interested in the PHP Tutorial, refer to it. Continue. This document describes the simplest steps for building a private repository.
In summary:
Install the registry image and start the container.
CA certificate (another way is to us
Role: Nginx do reverse proxy, in the access to the private warehouse with a password verification, the password is generated by htpasswdip:192.168.0.2271. Download registry2.0 imageDocker Pull registry:2.1.12. Installing NginxYum-y Install Nginx3. Create Docker warehouse data and configuration directorysudo mkdir-p/opt/docker
-- Permanentsystemctl Restart Firewall.service10. Portus InitializationOpen Create default Admin user in Browser650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M02/85/4E/wKiom1efhh2jb8x4AAFyZVdUIOY434.png "title=" image 1. PNG "alt=" Wkiom1efhh2jb8x4aafyzvduioy434.png "/>Connect to this Docker repository (or other warehouses, must be registry 2.0 or higher)650) this.width=650; "src=" Http://s4.51cto.
---------------------------------------------------- ---------------------------------------------------------------Open a Docker private warehouse edit " Span style= "font-family: ' The song body '; font-size:14px;" >/etc/sysconfig/docke docker_opts= "--insecure-registry docker.benet.com--tlsverify--tlscacert/etc/pki/ca/cacert.pem" Add inCopy the r
Starting with the docker1.3.2 version, the default Docker registry uses HTTPS, and when you use Docker pull non-HTTPS Docker regsitry, the following error is reported:Java code
Error:invalid Registry Endpoint ...Get ... If This
Continue, this article describes the simplest steps of building a private warehouse.
For the summary:
Install the registry image and start the container.
CA certificate (There is also a way to directly use HTTP also line, you can omit this step)
Make the image, publish it.
The simplest way to install registry is to pull a ready-made
-score-adjust int Set The Oom_score_adj for the Daemon (default-500)-P,--pidfile string Path to daemon PID file (default "/var/run/docker.pid")--raw-logs full timestamps without ANSI coloring--registry-mirror list Preferred Docker registry Mirror (default [])--seccomp-profile string Path to Seccomp profile--selinux-enabled Enable SELinux Support--shutdown-timeout
1. Download the repository Image
Docker pull Registry
2. Create a private repository container-D indicates that the background is startedDocker run-D-P 5000: 5000-V/opt/data/Registry:/var/lib/Registry
3. Remove port 5000 from the FirewallFirewall-cmd -- zone = public -- ad
It is important to note that the image files downloaded from the Docker pool are identical to the official image files.After installing Docker, you can use the official registry image to build a set of local private warehouse environments:
Docker run –d –p :
1, after the installation of Docker, you can easily set up a private warehouse through registry image.
[root@ip-10-249-100-205 ~]# Docker run-d-P 5000:5000 Registry
Automatically launches a registry container after the download co
The test environment is as follows:First, the installation of DockerInstallation method Please check the installation tutorial hereSecond, set up ordinary users 1. How to set up CentOS$ sudo gpasswd-a Docker ${user} 2. How to set up Ubuntu$ sudo usermod-ag Docker ${user}Third, the private library image download 1. Create a directory
Foreword because most of the image download websites are abroad, Chinese users often encounter slow download speeds when downloading images; in addition, when Docker is applied to the production environment, it also faces the security issue of the downloaded Docker image. Because some private data is built in the production environment
Preface
Because most of th
1. View Docker version information# docker Versionclient:version:18.03.0-ce API version:1.37 Go version:go1.9.4 Git commit:0520e24 built:wed Mar 21 23:09:1 5 2018 Os/arch:linux/amd64 Experimental:false orchestrator:swarmserver:engine:version:18.03.0-ce API version:1.37 (mi Nimum version 1.12) Go version:go1.9.4 Git commit:0520e24 built:wed Mar 23:13:03 2018 Os/arch:linux/amd64 Experime Ntal:false2. Build a
First need to use the domain name or hostname to create a certificate, self-signed certificate network can be used, because the intranet can eliminate trust problems, since the visa book process can refer to the use of self-signed certificate configuration Nginx HTTPS.Certificate production completed we started to deploy registry, the current registry V2 version has been released, so we use the V2 version o
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.