Use Docker Registry to quickly build a private image repository1. Background
In Docker, when we run docker pull xxx, we may be curious. Where will Docker find and download the image?
It is actually searched from the address regist
Sometimes it is inconvenient to use a public repository such as Docker Hub, and the company's private images are not pushed to the docker hub for business security. You can create a local repository for private use. Similar to git and maven, it saves the server bandwidth for downloading and uploading images.What is
Install the Harbor1.4.0 open-source docker image repository (including the letsencrypt certificate) and dockerletsencryptDocument version 20180216Harbor has been successfully installed on Ubuntu Linux 14.04 and CentOS Linux 7.4. The process is organized as follows for your reference:
Note: Use a non-root user to operate Docke
. Set the docker ServiceSet docker to start automatically
systemctl enable docker
4. Configure the image repositoryFirst, put the tar packages of the two images to be used./rootDirectory.
Then manually load the image and LoadregistryAnd then upload the
docker:/root# Docker PS CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f3cb864be528 192.168.32.150:5000/zjzc_centos6.5_templat E "Bash" about a minute ago up about a minute zjzc_test99 d25712059 702 192.168.32.150:5000/zjzc_centos6.5_m2 "bash" 7 minutes ago up 7 minutes Sick_wright 8302f2eb1c9e 192.168.32.150:50
Create a private repository for docker and a private repository for docker
Thanks to the network speed and the performance of the Greater China LAN, the image download speed in DockerHub is very slow. Even some domestic image ware
the returned results to install the Docker CE. The second column is the version information. The third column is the name of repository, which identifies the installation package from that repository and the stability of the current version. If you want to install the specified version, add the version number to the back of the package name (where the package na
Private Repositories in our own LAN to store our own images. Docker-Registry is the tool we need.
Use git to download the source code, modify the configuration file config. yml, and change the storage_path part to the storage location of the Docker image repository:
$ git clone https://github.com/dotcloud/
Install docker and private repository on centos71. initialize the networkAfter centos7 is installed, yum prompts that the domain name cannot be resolved. view the local network, ifconfig is unavailable, and ip commands in centos7 proxy ifconfig.Ip addr. Only the local loopback address is displayed.Cd/etc/sysconfig/network-scripts, ViewFile corresponding to the NIC nameOnboot is noChange to yes. After centos
Label: docker
Although the official docker hub of docker provides a lot of images, it basically includes what we need to use, but its access is slow. If you want to customize the image, sharing among multiple servers is inconvenient to use this image. At this time, we urge
. When the docker environment crashes, you can use these two scripts for initialization (the original virtual machine will be deleted, so be careful when using them ).
Install docker private Repository# Docker pull Registry# Docker run-D-P 5000: 5000/mnt/SDA/Registry:/tmp/
Recommended method for creating a Docker local repository
Docker supports registry to support image distribution and update management. This greatly facilitates users.
The official website dockerhub is provided as a public centralized repository. However, local access to doc
. Introduction to dockerfile Construction
The docker build command constructs a new docker Image Based on the dockerfile file and context. The build context refers to the local path or a URL (GIT repository address) of the dockerfile ). The build context environment will be recursively processed, so the path specified
machine and run the following command:cat./cacert.pem>>/etc/pki/tls/certs/ca-certificates.crt(3) Verificationdocker.yy.comRegistry:
Input in a browser:https://docker.yy.comOr:curl -i -k https://abc:123@docker.yy.com
(4) Steps for using private registry:
Logon:docker login -u abc -p 123 -e "test@gmail.com" https://docker.yy.com
Give the container another name:docker tag centos:centos6 docker.yy.com/centos:centos6
Release:docker push docker.yy.com/centos:centos6
6. Steps for opera
After using the Docker login command, you can push the image to the Dockerhub using the push command, but dockerhub on the public web, the free account has only one private repository free, All that remains is to be made public. Due to various restrictions, the creation of enterprise private warehouses has a variety of application scenarios. This article will bri
Environment preparation
Use two machines, one to do Docker private warehouse, one to do Docker image submission
Make sure Docker is installed on both machines and start the Docker service
The name of the Docker pr
How to deal with Docker private repository Registry and dockerregistry in minutes
1. What is the Docker private repository Registry?
The official Docker hub is a good place to manage public images. We can find the image we want an
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 -- add-Port = 5000/tcp -- Permanent
4. Verify that
: 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
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.