Docker mirror (six)

First, what is a mirror

  Mirroring is a lightweight, standalone executable software package used to package software operating environment and software-based operating environment developed, it contains everything you need to run a piece of software, including code, runtime libraries, environment variables and configuration files.

1. UnionFS (jointly file system)

  Union File System (UnionFS) is a layered, lightweight and high-performance file system that supports changes to the file system as a superposition of layers of time to submit, at the same time in different directories can be mounted to the same virtual the file system (unite several directories into a single virtual filesystem). Union file system is the basis Docker image. Mirroring can be inherited by layering, on the basis of image (no parent image), can create a variety of specific applications image.

  Features: load multiple files at one time systems, but the outside looks, only to see a file system, the file system layers of joint load will stack up, so that the final document will contain all the underlying files and directories.

2. Docker image loading principle

  docker's mirror is actually composed of layers of file system components, such hierarchical file system called UnionFS.

  bootfs (boot file system) consists mainly bootloader and kernel, bootloader mainly boot loader kernel, loads bootfs file system Linux has just started, the lowest level in Docker image is bootfs. This is one of our typical Linux / Unix systems is the same, which contains the boot loader and the kernel. When the boot to complete the kernel is loaded in memory, and this time the right to use the memory bootfs has been transferred to the kernel, then the system will unload bootfs.

  the rootfs (the root File System) , above bootfs. Included is a typical Linux system, / dev, / proc, / bin , / etc and other standard directories and files. rootfs is a variety of different operating system releases, such as Ubuntu, Centos and so on. Included is a typical Linux system, / dev, / proc, / bin , / etc and other standard directories and files. rootfs is a variety of different operating system releases, such as Ubuntu, Centos and so on.

  Usually we install CentOS into the virtual machine is several G, Why docker here only 200M?

  For a streamlined OS, rootfs can be very small, including only the most basic commands, tools, and libraries can be, because the underlying kernel Host directly, and they only need to provide rootfs on the line. This shows that for different linux distributions, bootfs basically the same, rootfs will be different, so different distributions can be public bootfs.

3. layered image

  To pull our example, the download process we can see the docker's image seems to be in one layer in the download.

4. Why Docker mirror to use this hierarchy it

  The biggest advantage is a shared resource. For example: There are built from multiple mirrors from the same base image, then the host simply save a base image on disk, and memory also just load a base image, you can assume that all the container services. And each layer of the mirror can be shared.

Two, Docker features

Docker image are read-only, when the container starts, a new writable layer is loaded on top of the mirror. This layer is typically referred to as "the container layer", called "image layer" below "the container layer."

Three, Docker mirror commit operation

# Docker the commit submit a copy of the container to make it a new image 
# Docker the commit -m = "description of the information submitted" -a = "author" target image name container ID to be created: [tag name]

Case presentation:

1. Download from the mirror to the local Hub tomcat and run successfully

# Pulling mirror 
Docker pull Tomcat 

# new vessel and start 
# -p host port: docker container port 
# -P randomly assigned port 
# -i: interactive 
# -t: terminal 
Docker Expediting IT -p 8080 RUN: 8080 Tomcat 

# randomized host port, docker inside the container or port 8080 
Docker Expediting IT RUN - P Tomcat
 # Docker -a PS can view randomly assigned to port (pORTS)

2. Previous deliberately delete the document image production tomcat container

 

Guess you like

Origin www.cnblogs.com/myitnews/p/11511144.html