In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
The most direct way to save and distribute images is to use Docker H u b, a public Regsitry maintained by Docker, where users can save their images to Docker H u b's free repository. If you do not want others to access your own image, you can also buy private repository.
Generally speaking, we can upload and download images using Docker H u b. Although it is very convenient, there are still some restrictions, such as:
1. Requires an external network connection, and the upload and download speed is slow.
2. The image uploaded to Docker H u b can be accessed by anyone. Although you can use private repositroy, it is not free.
3. For security reasons, many organizations do not allow images to be placed on the public network.
The solution is a local Registry in a single room.
Docker has made Registry open source, and there is also an official mirror Registry on Docker H u b.
We can run our own Registry in Docker
Using dockerfile to build httpd
Before using the repository, let's first build a httpd image and save it locally
First create the dockerfile directory and create the dokcerfile file
Cd ~ mkdir dokcerfile cd dockerfiletouch dockerfie
Edit the dockerfile as follows
Then build the http image
Docker build-t httpd:v11-f dockerfile / root/dockerfile
As shown below, the build is successful
Check the mirror image
Docker images
Start the registry container
First create the / myregistry directory under the root directory to store the mirrored data
The image used this time is registry:2
Cd / mkdir / myregistry
Create a registry container using the following command
Docker run-d-p 5000UR 5000-v / myregistry:/var/lib/registry registry:2
Description:
1.-d launch the container in the background
2.-p maps port 5000 of the container to port 5000 of Host. 5000 is the registry service port
3.-v map the container's / var/lib/regsitry directory to Host's / myregistry, which is used to store mirrored data
Rename the mirror through docker tag to match the registry, as follows:
Docker tag yangchao/httpd:v1 127.0.0.1:5000/yangchao/httpd:v1
Change httpd:v11 to the format required by Registry, in the following format:
Only images on Docker Hub can omit registry-host: [port]
Rename the mirror to match the registry through docker tag as follows
Docker tag httpd:v11 127.0.0.1:5000/yangchao/httpd:v11
Use the dokcer image command to check the mirror
Then upload yangchao/httpd:v11 to Registry
Docker push 127.0.0.1:5000/yangchao/httpd:v11
Then view the mirror in Registry
Curl 127.0.0.1:5000/v2/_catalog
You can view the corresponding image in the / myregistry directory
At this point, the local registry is created
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.