zoukankan      html  css  js  c++  java
  • docker image

    A Docker image is made up of filesystems layered over each other. At the base is a boot filesystem, bootfs, which resembles the typical Linux/Unix boot filesystem. A Docker user will probably never interact with the boot filesystem. Indeed, when a container has booted, it is moved into memory, and the boot filesystem is unmounted to free up the RAM used by the initrd disk image.

    So far this looks pretty much like a typical Linux virtualization stack. Indeed, Docker next layers a root filesystem, rootfs, on top of the boot filesystem. This rootfs can be one or more operating systems (e.g., a Debian or Ubuntu filesys- tem).

    In a more traditional Linux boot, the root filesystem is mounted read-only and then switched to read-write after boot and an integrity check is conducted. In the Docker world, however, the root filesystem stays in read-only mode, and Docker takes advantage of a union mount to add more read-only filesystems onto the root filesystem. A union mount is a mount that allows several filesystems to be mounted at one time but appear to be one filesystem. The union mount overlays the filesystems on top of one another so that the resulting filesystem may contain files and subdirectories from any or all of the underlying filesystems.

    Docker calls each of these filesystems images. Images can be layered on top of one another. The image below is called the parent image and you can traverse each layer until you reach the bottom of the image stack where the final image is called the base image. Finally, when a container is launched from an image, Docker mounts a read-write filesystem on top of any layers below. This is where whatever processes we want our Docker container to run will execute.

    When Docker first starts a container, the initial read-write layer is empty. As changes occur, they are applied to this layer; for example, if you want to change a file, then that file will be copied from the read-only layer below into the read- write layer. The read-only version of the file will still exist but is now hidden underneath the copy.

    This pattern is traditionally called “copy on write” and is one of the features that makes Docker so powerful. Each read-only image layer is read-only; this image never changes. When a container is created, Docker builds from the stack of im- ages and then adds the read-write layer on top. That layer, combined with the knowledge of the image layers below it and some configuration data, form the con- tainer. As we discovered in the last chapter, containers can be changed, they have state, and they can be started and stopped. This, and the image-layering frame- work, allows us to quickly build images and run containers with our applications and services.

    image

    WARNING: No any other purpose,keeping reminded! So sorry to offended,if necessary, contact me and I do change what I had done to protect your privileges!
  • 相关阅读:
    学习笔记:javascript 窗口对象(window)
    学习笔记:javascript内置对象:数组对象
    学习笔记:javascript内置对象:日期对象
    学习笔记:javascript内置对象:数学对象
    学习笔记:javascript内置对象:字符串对象
    初次尝试轮播图
    今天我开通了博客园
    javaweb项目运转流程
    idea tomcat启动无效
    mysql事务管理及spring声明式事务中主动异常抛出使数据库回滚
  • 原文地址:https://www.cnblogs.com/MimiSnowing/p/14862829.html
Copyright © 2011-2022 走看看