How to build a local mirror warehouse
1. Environment and preparation work
ubuntu14.04
docker environment
(recommended tutorial :docker tutorial)
2. Building steps
1. Change the image source (because the default one is too slow, and the domestic one is faster)
sudo vim /etc/default/docker
Enter the following parameters:
DOCKER_OPTS="--registry-mirror=http://hub-mirror.c.163.com" //网易的,也可以使用daoClouds的
If it is a newly installed ubuntu environment, execute the following command (of course you can also use vi, or write directly)
sudo apt-get update //更新apt-get源,防止下载出错 sudo apt-get install vim -y //下载vim
2. Start docker and pull the registry image source
sudo service docker start //启动docker sudo docker pull registry //下载registry镜像
3. After downloading, check whether the download is successful
sudo docker images
4. Download After starting the container later, you can mount the data mapping in the container on the directory you specify. Here, /opt/data/registry is the directory where the host is stored
mkdir -p /opt/data/registry //创建目录 sudo docker run -d -p 5000:5000 -v /opt/data/registry:/var/lib/registry --name private_registry registry //启动容器 -d : 让容器可以后台运行 -p :指定映射端口(前者是宿主机的端口号,后者是容器的端口号) -v :数据挂载(前者是宿主机的目录,后者是容器的目录) --name : 为运行的容器命名
5. Then check whether the container is successfully started
sudo docker ps
6. Check the IP address of the host machine
ifconfig
7. Change the docker configuration file, Add your own private library address. Docker will load /etc/init/docker.conf when it starts. After reading the configuration file, you will find that it will load the /etc/default/docker file, so you only need to write the private library address to /etc /default/docker
sudo vim /etc/default/docker
8. Change DOCKER_OPTS to the following:
DOCKER_OPTS="--registry-mirror=http://hub-mirror.c.163.com --insecure-registry 192.168.147.129:5000"
The 5000 port must be added. The host accesses port 80 by default. If you don’t want to add it, you can start the container. When mapping the container's port 5000 to the host's port 80
9. After modification, restart the container and enable the registry service
sudo service docker restart //重启容器 sudo docker start private_registry //重启registry服务
The above five steps will build a private library.
3. Test
1. Pull an image and tag it (take busybox as an example, because busybox is relatively small)
sudo docker pull busybox:latest //拉取镜像 sudo docker tag busybox:latest 192.168.147.129:5000/busybox
2. Submit the tag image to your local image warehouse
sudo docker push 192.168.147.129:5000/busybox
3. Delete all images about busybox and view
sudo docker rmi busybox 192.168.147.129:5000/busybox //删除busybox镜像 sudo docker images //查看是否还有busybox镜像的信息
4. Pull busybox from the local image warehouse Mirror and view
sudo docker pull 192.168.147.129:5000/busybox sudo docker images //查看192.168.147.129:5000/busybox镜像的信息
If the above prompt appears, it means the pull is successful.
The above is the detailed content of How to build a local mirror warehouse. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics





ao3 mirror is a platform for creating fan fiction, but most friends don’t know where the official website of ao3 mirror is. Click on the https://ao3.cubeart.club/ link to enter the ao3 mirror website. The next step is The editor brings users an introduction to the latest official website entrance of ao3 mirror 2024. Interested users come and take a look! ao3 mirror official website entrance: https://ao3.cubeart.club/ 1. Download address 1. AO3: Click to download》》 2. AO3 latest version: Click to download》》 2. Enter the website method 1. Copy the website to View it in the browser and click [LogIn] in the upper right corner of the page to enter; 2. Account

Turn off AirPlay on Mac via Control Center You can quickly turn off AirPlay in Mac OS Ventura 13 or later by doing the following: On a Mac with AirPlay enabled, go to Control Center in the upper right corner by clicking the two switch appearance icon and select " "Screen Mirroring" From the menu that appears, select the screen your Mac is AirPlay mirroring to. This will disconnect AirPlay and turn it off. You can also turn on ScreenMirroring and AirPlay this way, which you probably already know by now if you enabled it in the first place. . Disconnect AirPla on Mac via system settings

Screen mirroring is the best option when you want to view or display content from a small screen to a large screen (for example, from a laptop to a TV). While you may have heard of the option to mirror your smartphone screen to your TV or laptop, you can also mirror your laptop screen to your TV. This will allow you to view the content on a larger screen. The process of mirroring your laptop screen to your TV can be done in a variety of ways, including wired and wireless. It's up to you which option you want to continue using. On the one hand, the wired approach gives you a reliable mirroring experience with low latency. However, the wireless method eliminates the need to find a compatible cable for mirroring and can be done between two supported devices. The only downside is that you'll experience some lag and sometimes low-resolution mirroring

When loading CentOS-7.0-1406, there are many optional versions. For ordinary users, they don’t know which one to choose. Here is a brief introduction: (1) CentOS-xxxx-LiveCD.ios and CentOS-xxxx- What is the difference between bin-DVD.iso? The former only has 700M, and the latter has 3.8G. The difference is not only in size, but the more essential difference is that CentOS-xxxx-LiveCD.ios can only be loaded into the memory and run, and cannot be installed. Only CentOS-xxx-bin-DVD1.iso can be installed on the hard disk. (2) CentOS-xxx-bin-DVD1.iso, Ce

According to Huawei’s official news, the Open Atomic Developer Conference, with the theme of “Everything for Developers”, was held in Wuxi for two days, from December 16 to 17. The conference was led by the Open Atomic Open Source Foundation, Huawei, and Inspur. , DaoCloud, Xieyun, Qingyun, Hurricane Engine, as well as the OpenSDV Open Source Alliance, openEuler community, OpenCloudOS community and other member units jointly initiated the construction of the AtomHub Trusted Mirror Center, which is officially open for public testing. AtomHub adheres to the concepts of co-construction, co-governance, and sharing, and aims to provide open source organizations and developers with a neutral, open and co-constructed trusted open source container mirror center. In view of the instability and uncontrollability of image warehouses such as DockerHub, and some

Receiving error codes or error messages on Windows operating systems is very common, almost all of us have encountered one while using Microsoft operating systems. Windows 11 is no different from other Windows operating systems. A common error encountered by many Windows 11 users is related to Miracast not working properly. Miracast is a Windows service from Microsoft that allows you to cast your screen to other monitors. This feature is built into Windows 11, and you need to connect your device and other monitors to the same Wi-Fi connection to cast content. If you want to tell your friends or

Golang image manipulation: How to mirror, rotate and flip images 1. Introduction Image processing is one of the needs we often encounter in many development scenarios. In Golang, we can use the image package to operate and process images. This article will focus on how to use Golang to mirror, rotate and flip images, and provide corresponding code examples. 2. Mirroring operation Mirroring a picture is to change the left and right layout of the picture. In Golang, you can use Fli of the draw package

Title: Using Java to develop the commodity management function of the warehouse management system 1. Introduction With the advancement of science and technology and the development of informatization, enterprise warehouse management has become more and more important. In order to improve the efficiency and accuracy of warehouse management, many companies have begun to adopt warehouse management systems. This article will use Java language to develop the commodity management function of a warehouse management system and provide readers with specific implementation code examples. 2. Demand analysis In the warehouse management system, product management functions mainly include operations such as adding, deleting, modifying and viewing products. based on
