Home Operation and Maintenance Docker What does image mean in docker

What does image mean in docker

Dec 30, 2021 am 11:38 AM
docker

In docker, image means "mirror" and is a file system; image can mount several layers of directories together to form a virtual file system with the same directory structure as Linux. Docker passes these files In addition, the host's kernel provides a Linux virtual environment.

What does image mean in docker

The operating environment of this tutorial: linux7.3 system, docker-1.13.1 version, Dell G3 computer.

What does image mean in docker

image Inside is a layer-by-layer file system called Union FS (Union File System).

United file system can mount several layers of directories together to form a virtual file system. The directory structure of the virtual file system is just like the directory structure of ordinary Linux. Docker provides a Linux virtual environment through these files and the kernel of the host.

Each layer of file system is called a layer. The joint file system can set three permissions for each layer of file system, read-only (readonly), read-write (readwrite) and write-out (whiteout-able). ), but each layer of the file system in the docker image is read-only.

When building an image, starting from the most basic operating system, each build operation is equivalent to making a layer of modifications and adding a layer of file system. Layer by layer, modifications to the upper layer will cover the visibility of the lower layer. This is easy to understand, just like the upper layer covers the bottom layer.

When you use it, you will only see a complete whole. You don't know how many layers there are, and you don't know what the modifications made to each layer are. The structure is similar to this:

What does image mean in docker

#From a basic point of view, a typical Linux file system consists of bootfs and rootfs. bootfs (boot file system) mainly includes bootloader and kernel , bootloader is mainly used to boot and load the kernel. When the kernel is loaded into the memory, bootfs will be umounted.

rootfs (root file system) contains standard directories and files such as /dev, /proc, /bin, /etc, etc. in a typical Linux system. The following figure shows the most basic two-layer structure in the docker image. Different Linux distributions (such as ubuntu and CentOS) will have differences in the rootfs layer, reflecting the differences in distribution versions.

What does image mean in docker

When traditional Linux loads bootfs, it will first set rootfs to read-only, and then change rootfs from read-only to read-write after system self-test, and then We can then perform read and write operations on rootfs.

But Docker will not change the read-only of rootfs to read-write after the bootfs self-test is completed. Instead, it will use union mount (a mounting mechanism of UnionFS) to change other layers in the image. Loaded onto the previous read-only rootfs layer, each layer is a rootfs structure and is read-only. Therefore, we cannot modify the layer in an existing image!

Only when we create a container, that is, instantiate the Docker image, the system will allocate an empty read-write rootfs to save the modifications we make. The changes saved by a layer are incremental, just like git.

What does image mean in docker

#To sum up, image is actually a file system, which together with the host's kernel provides a virtual Linux environment for the program. When starting a docker container, docker will build a virtual Linux environment for the container based on the image.

Recommended learning: "docker video tutorial"

The above is the detailed content of What does image mean in docker. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to develop a complete Python Web application? How to develop a complete Python Web application? May 23, 2025 pm 10:39 PM

To develop a complete Python Web application, follow these steps: 1. Choose the appropriate framework, such as Django or Flask. 2. Integrate databases and use ORMs such as SQLAlchemy. 3. Design the front-end and use Vue or React. 4. Perform the test, use pytest or unittest. 5. Deploy applications, use Docker and platforms such as Heroku or AWS. Through these steps, powerful and efficient web applications can be built.

How to deploy a PyTorch app on Ubuntu How to deploy a PyTorch app on Ubuntu May 29, 2025 pm 11:18 PM

Deploying a PyTorch application on Ubuntu can be done by following the steps: 1. Install Python and pip First, make sure that Python and pip are already installed on your system. You can install them using the following command: sudoaptupdatesudoaptinstallpython3python3-pip2. Create a virtual environment (optional) To isolate your project environment, it is recommended to create a virtual environment: python3-mvenvmyenvsourcemyenv/bin/activatet

Performance Tuning of Jenkins Deployment on Debian Performance Tuning of Jenkins Deployment on Debian May 28, 2025 pm 04:51 PM

Deploying and tuning Jenkins on Debian is a process involving multiple steps, including installation, configuration, plug-in management, and performance optimization. Here is a detailed guide to help you achieve efficient Jenkins deployment. Installing Jenkins First, make sure your system has a Java environment installed. Jenkins requires a Java runtime environment (JRE) to run properly. sudoaptupdatesudoaptininstallopenjdk-11-jdk Verify that Java installation is successful: java-version Next, add J

How to implement automated deployment of Docker on Debian How to implement automated deployment of Docker on Debian May 28, 2025 pm 04:33 PM

Implementing Docker's automated deployment on Debian system can be done in a variety of ways. Here are the detailed steps guide: 1. Install Docker First, make sure your Debian system remains up to date: sudoaptupdatesudoaptupgrade-y Next, install the necessary software packages to support APT access to the repository via HTTPS: sudoaptinstallapt-transport-httpsca-certificatecurlsoftware-properties-common-y Import the official GPG key of Docker: curl-

Is java a software? Introduction to Java's running environment and development tools Is java a software? Introduction to Java's running environment and development tools May 20, 2025 pm 08:30 PM

Of course, Java is a very important software. Java includes JRE and JDK. JRE allows programs to be "written at once and run everywhere", while JDK provides compilers and development tools to improve development efficiency.

What is Docker BuildKit, and how does it improve build performance? What is Docker BuildKit, and how does it improve build performance? Jun 19, 2025 am 12:20 AM

DockerBuildKit is a modern image building backend. It can improve construction efficiency and maintainability by 1) parallel processing of independent construction steps, 2) more advanced caching mechanisms (such as remote cache reuse), and 3) structured output improves construction efficiency and maintainability, significantly optimizing the speed and flexibility of Docker image building. Users only need to enable the DOCKER_BUILDKIT environment variable or use the buildx command to activate this function.

How does Docker work with Docker Desktop? How does Docker work with Docker Desktop? Jun 15, 2025 pm 12:54 PM

DockerworkswithDockerDesktopbyprovidingauser-friendlyinterfaceandenvironmenttomanagecontainers,images,andresourcesonlocalmachines.1.DockerDesktopbundlesDockerEngine,CLI,Compose,andothertoolsintoonepackage.2.Itusesvirtualization(likeWSL2onWindowsorHyp

How can you monitor the resource usage of a Docker container? How can you monitor the resource usage of a Docker container? Jun 13, 2025 am 12:10 AM

To monitor Docker container resource usage, built-in commands, third-party tools, or system-level tools can be used. 1. Use dockerstats to monitor real-time: Run dockerstats to view CPU, memory, network and disk IO indicators, support filtering specific containers and recording regularly with watch commands. 2. Get container insights through cAdvisor: Deploy cAdvisor containers to obtain detailed performance data and view historical trends and visual information through WebUI. 3. In-depth analysis with system-level tools: use top/htop, iostat, iftop and other Linux tools to monitor resource consumption at the system level, and integrate Prometheu

See all articles