当前位置:网站首页>Publish local image to private library
Publish local image to private library
2022-07-24 11:02:00 【Scattered_ step】
Publish local image to private library process :
What is it? :
1 official Docker Hub Address :https://hub.docker.com/, Chinese mainland visits are too slow and are ready to be replaced by Ali cloud. , Not very mainstream .
2 Dockerhub、 Public image warehouses like Alibaba cloud may be inconvenient , Companies involved in confidentiality cannot provide images to the public network , So you need to create a local private warehouse for the team to use , Build a mirror image based on internal projects .
Docker Registry It's an official tool , It can be used to build a private image warehouse
Push local image to private library :
1. Download mirroring Docker Registry


2. Run private library Registry, It is equivalent to having a local private Docker hub
docker run -d -p 5000:5000 -v /zzyyuse/myregistry/:/tmp/registry --privileged=true registry
By default , The warehouse is created in the container /var/lib/registry Under the table of contents , It is recommended to use container volume mapping by yourself , It is convenient for the joint commissioning of host computer 
3. The case demonstrates creating a new image ,ubuntu install ifconfig command :
** from Hub Upload and download ubuntu Mirror to local and run successfully
The original Ubuntu The mirror image is without ifconfig Ordered :**

When the external network is connected , install ifconfig Command and test passed :
docker Execute the above two commands in the container :
apt-get update
apt-get install net-tools

After installation ,commit Our own new image :
The formula :
docker commit -m=“ Description information submitted ” -a=“ author ” Containers ID The target mirror name to create :[ Tag name ]
command : Execute outside the container , Remember
docker commit -m=“ifconfig cmd add” -a=“zzyy” a69d7c825c4f zzyyubuntu:1.2
Start our new image and compare it with the original :
1 The official website is downloaded by default Ubuntu No, ifconfig command
2 Our own commit Build a new image , The new increased ifconfig function , Can be used successfully .
4. curl Verify what image exists on the private server library
curl -XGET http://192.168.111.162:5000/v2/_catalog
You can see , At present, there is no image uploaded in the private server Library ......
5. Mirror the new image zzyyubuntu:1.2 Modify the private server specification Tag
According to the formula : docker tag Mirror image :Tag Host:Port/Repository:Tag
own host host IP Address , Fill in your own , Don't paste errors ,O(∩_∩)O
Use command docker tag take zzyyubuntu:1.2 This image is changed to 192.168.111.162:5000/zzyyubuntu:1.2
docker tag zzyyubuntu:1.2 192.168.111.162:5000/zzyyubuntu:1.2
6. Modify the configuration file to support http

Don't copy without thinking ,registry-mirrors The image acceleration address provided by Alibaba in China is configured , If you don't need to speed up, the access to the official website will be very slow .
2 There is a comma in the middle of the configuration ',' Don't miss , This configuration is json Format .
2 There is a comma in the middle of the configuration ',' Don't miss , This configuration is json Format .
2 There is a comma in the middle of the configuration ',' Don't miss , This configuration is json Format .
vim Add the following red content to the command :vim /etc/docker/daemon.json
{
“registry-mirrors”: [“https://aa25jngu.mirror.aliyuncs.com”],
“insecure-registries”: [“192.168.111.162:5000”]
}
For the above reasons :docker Not allowed by default http Mode push mirror , Remove this restriction by configuring options .====> After modification, if it does not take effect , Suggest restart docker
7.push Push to private server Library
docker push 192.168.111.162:5000/zzyyubuntu:1.2
8.curl Verify what image exists on the private server library 2
curl -XGET http://192.168.111.162:5000/v2/_catalog
9.pull Go local and run
docker pull 192.168.111.162:5000/zzyyubuntu:1.2
docker run -it Mirror image ID /bin/bash
Save the image as a compressed package
docker save -o abc.tar guignginx:v1.0
Other machines load this image
docker load -i abc.tar
边栏推荐
- redis 缓存设置,实现类似putIfAbsent功能
- 爬虫与反爬:一场无休止之战
- Detailed explanation of Flink operation architecture
- 在idea中System.getProperty(“user.dir“)识别到模块(module)路径的方法:Working directory的设置
- 基于NoCode构建简历编辑器
- [interview: Basics 03: selection sort]
- I admire a Google boss very much, and he left..
- How to gracefully realize idempotency and distributed current limiting of distributed interfaces (glory Collection Edition)
- Qt应用程序防止多开,即单例运行
- 对话ACE第四期:分布式数据库未来发展的挑战和机遇
猜你喜欢
随机推荐
read_ CSV error: 'GBK' codec can't decode byte 0xb4 in position 274: illegal multibyte sequence
563 pages (300000 words) overall design scheme of smart Chemical Park (phase I)
Artifact ffmpeg - operation video, extremely comfortable
Simply use MySQL index
PC Museum (1) 1970 datapoint 2000
爬虫与反爬:一场无休止之战
Zero basic learning canoe panel (9) -- combobox
5个最佳WordPress广告插件
测试左移和测试右移,我们为何要“上下求索”?
Zero basic learning canoe panel (7) -- input/output box
Call bind apply simple summary
[interview: Basics 02: bubble sort]
【白帽子讲Web安全】第二章 浏览器安全
小熊派学习——内核开发
轻松读懂三极管,原来它是这样工作的
Why should we "go up and down" when testing left shift and right shift?
[micro service] eureka+ribbon realizes registration center and load balancing
Dialogue ace phase IV: challenges and opportunities for the future development of distributed databases
[dish of learning notes dog learning C] detailed operator
零基础学习CANoe Panel(3)—— 静态控件(Static Text , Group Box ,Picture Box)




![[attack and defense world web] difficulty five-star 15 point advanced question: ics-07](/img/97/555a76be9e96629fd7379ce8612a3b.png)




