Docker brief, container

A container

1 What is the container
vessel will be packaged into standardized software unit, for the development, delivery and deployment.
Mirroring container is lightweight, standalone executable package that contains everything you need to run the software: code, run-time environment, system tools, system libraries and settings.
Containerized software for Linux and Windows-based applications, are able to consistently run in any environment.
Container gives software independence from the effects of external environmental differences (eg, differences in the development and rehearsal environment), thus helping to reduce conflicts between teams running different software on the same infrastructure.
Here Insert Picture Description

2 containers of difference with virtualization
container virtualization is the operating system rather than the hardware, the vessel is between the same set of operating system shared resources. After the virtual virtual machine technology is a set of hardware, run a full operating system on it.
What are the two Docker
Docker use Google launched the Go language development to achieve, based on cgroup, namespace, and UnionFS AUFS class technology such as the Linux kernel, the process of encapsulation isolation, belonging to the virtualization operating system level. Since the isolation process independently of the host and other isolation processes, and therefore also referred to as a container. Docke initial implementation is based on LXC.
Docker can automate repetitive tasks such as set up and configure the development environment, which frees developers so that they can focus on the really important things: building great software.
Users can easily create and use a container, put their applications into the container. The container may also be version management, copying, sharing, modifying, managing general code like the same.
Features 1 Docker's
lightweight running on a single machine multiple Docker containers can share the machine's operating system kernel; they can quickly start just takes up very little memory and computing resources. Mirroring is constructed by a file system layer, and share some common file. This will minimize disk usage, and can quickly download images.
Standard, Docker containers, based on open standards can run on all major versions of Linux, Microsoft Windows and any infrastructure includes VM, including bare metal server and cloud.
Safety, Docker given application isolation is not limited to isolated from each other, but also independent of the underlying infrastructure. Docker default provide the strongest isolation, so the application problems, it is only a matter of a single container, without spread to the entire machine.
2 Docker Basic Concepts
image (Image)
of the container (Container)
Warehouse (Repository)

1) image (Image )
operating system kernel and user space divided. For the latter Linux, the kernel starts, it will mount the root file system to provide user-space support. The Docker image (Image), the equivalent of a root file system.
Docker image is a special file system, in addition to providing the desired containers run programs, libraries, resources, and other configuration files, further comprising a number of configuration parameters for the preparation of runtime (e.g. anonymous volume, environment variables, user, etc. ). Image does not contain any dynamic data, its contents will not be changed after the construct.
When constructing the mirror, will build a layer, the previous layer is the basis of the latter layer. Each layer you've built will not change, any change in the level occurs only in his own this layer. For example, one file before delete operation, the actual not really delete the previous layer files, but only deleted in the current layer mark for the file. When the final container to run, though not seen this document, but in fact the file will always follow the mirror. Therefore, when building the image, you need to be extra careful, try each layer of the layer containing only thing you need to add any extra things to be cleared away before the end of the layer build.
Further characterized in that the tiered storage mirror multiplexing, the customized becomes easier. Even before you can build a good image as a base layer, and then further adding a new layer to customize the content they need to build a new image.

2) a container (Container )
entity mirror runtime
mirror image (Image) and the container (Container), like object-oriented programming classes and instances, the mirror is statically defined, the container is a solid mirror runtime . Container can be created, start, stop, delete, pause.
The process is the essence of container, but in a different process and direct the implementation of the host, the container processes running in their own namespace independent. Recall mirroring is tiered storage container as well.
Lifetime of the storage layer and the container as the container, the container die, the container also will die of the memory layer. Therefore, any container stored in the storage layer information will be deleted with the container lost.
Docker best practices as required, the container should not write any data to which the storage layer, the storage layer to keep the container free of state. All file write operations, volume data should be used (Volume), or binding directory host, reading and writing these locations will skip container storage layer to read and write to the host (or network storage) occurs directly, and its performance higher stability. Lifetime data volume is independent of the container, which die, the data volume will not die. Therefore, the use of data volumes, the container can arbitrarily delete and re-run, but the data will not be lost.
3) Warehouse (Repository )
centralized repository where the image file
mirroring build is complete, you can easily run on the current host, but if you need to use this image on another server, we need a centralized storage, distribution mirrored service, Docker Registry is one such service.
It may comprise a plurality of Docker Registry repository (the Repository); each warehouse may comprise a plurality of tags (the Tag); each tag corresponds to a mirror. So: Mirror Docker warehouse is a centralized repository used to place the image file is similar to our previous common code repository.
Typically, a warehouse will contain different versions of the same software image, and label it to be commonly used in various versions of the software. We can <repository name>: <tag> format to specify which version of the software specifically a mirror. If the tag is not given, the default will be the latest label.

Published 20 original articles · won praise 36 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_41426763/article/details/102081149