Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Docker mirroring operation

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Docker Mirror

Similar to the image of a virtual machine, it can be understood as a read-only template for the Docker engine, including the file system.

For example, an image can fully contain the Linux operating system environment, and it can be called a Linux image. An image can also have an Apache application (or other software) installed, and it can be called an Apache image.

Images are the basis for creating Docker containers. Through version management and incremental file systems, Docker provides a very simple mechanism to create and update existing images. Users can download a completed application image from the Internet and use it directly through the command. In short, applications need an environment to run, and mirroring is to provide such an environment.

Docker container

Similar to a lightweight sandbox (because Docker is a virtual technology based on the Linux kernel, it consumes very few resources), Docker uses containers to run and isolate applications.

Docker warehouse

Similar to the code repository, it is the place where image files are stored centrally in Docker.

Sometimes you see materials that confuse the Docker repository with the registration server (Registry) and do not make a strict distinction. In fact, the registration server is the place where the warehouse is stored, and there are often multiple warehouses on it. Each warehouse stores a certain type of image, which often includes multiple image files, which are distinguished by different tag. For example, the repository where Ubuntu operating system images are stored is called Ubuntu repository, which may include different versions of images such as 14.04 and 12.04.

According to whether the stored images are publicly shared or not, Docker repositories are divided into public repositories (Public) and private repositories (Private).

At present, the largest public repository is Docker Hub, which stores a large number of images for users to download. Domestic open warehouses, including Docker Pool, can provide stable domestic access. If users do not want to share their image files publicly, Docker also allows users to create a private repository within the local network that can only be accessed by themselves.

After users have created their own image, they can use push to upload it to a specified public or private repository. So the next time you use the image on another machine, you just need to pull it from the repository.

Mirror related operations 1. Search for an image

Docker search nginx

two。 Get the image

Docker pull nginx

3. View Mirror

Docker images # View download image information

Docker inspect c7460dfcab51 # get image details

4. Add a new label to the image

Docker tag nginx nginx:nginx

Docker images | grep nginx # View

5. Delete Mirror

Docker rmi nginx:nginx # Delete according to tag

6. Load and check out images

The saved image is named nginx and exists in the current directory.

Docker save-o nginx nginx

Ls | grep nginx

Load Mirror

Method 1: docker load < nginx

Docker images # View the image

Method 2: docker load-input nginx

7. Upload image

Docker tag nginx 1451772664/nginx:centos7 # change tag user name / warehouse name: image name

Docker login # login

Docker push 1..64/nginx:centos7 # upload

Log in to https://hub.docker.com/ to view

Warm Tip: login to docker Public Warehouse requires registration before you can use it. Registration address: https://hub.docker.com/

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report