This is a creation in Article, where the information may have evolved or changed. **1**. What is Docker, unlike traditional virtual machines, why use Docker. Docker is based on the Linux kernel's cgroup,namespace, and the AUFS class of Union FS and other technologies, encapsulation of processes, belonging to the operating system level of virtualization technology, because the isolated process is independent of the host and other isolated processes, also known as containers. Docker is further encapsulated on the basis of containers, from file systems, network interconnection to process isolation, and so on, greatly simplifying the creation and maintenance of containers, making it more portable and faster than traditional virtual machine technology. Compared with the traditional virtual machine technology, the traditional virtual machine technology is a virtual set of hardware, running a complete operating system on it, and then running the required application process on the operating system, while the container application process runs in the host kernel, the container does not have its own kernel, and there is no virtual hardware, so Docker is more portable than traditional virtual machine technology. [Image.png] (https://static.studygolang.com/180117/a60b79e5d3037508641d071ee0f7ad80.png) * * Traditional virtual machine technology **! [Image.png] (https://static.studygolang.com/180117/99a8cfda8563e052bc1a546ad83d5414.png) **docker**** the reason for using Docker **1. Utilize system resources more efficiently 2. Faster Start-up time (seconds) 3. Consistent operating environment, avoid "This code on my computer to do no problem" this situation 4. Continuous delivery and deployment for development and operations (DEVOPS) people, the best thing to do is create or configure it once, and it can work anywhere. With Docker, you can customize application mirroring for continuous integration, continuous delivery, and deployment. Developers can use Dockerfile for mirroring and integration testing in conjunction with a continuous integration (continuous integration) system, while OPS can quickly deploy the image directly in a production environment, even in conjunction with continuous deployment (continuous Delivery/deployment) system for automatic deployment. and using Dockerfile to make the image transparent, not only is the development team able to understand the application runtime environment, but also facilitates the OPS team to understand the conditions required for the application to run, and to help deploy the image in a better production environment. 5. Easier migration because Docker ensures the consistency of the execution environment, it makes it easier to migrate applications. Docker can be used in veryRunning on multiple platforms, whether it's physical, virtual, public, private, or even notebook, the results are consistent. As a result, users can easily migrate applications running on one platform to another without worrying about changes in the operating environment that could prevent the application from running properly. 6. Easier maintenance extends Docker's use of tiered storage and mirroring technology, making it easier to reuse reusable parts of the application, and making maintenance updates easier, and further extending the image based on the underlying image is easy. In addition, the Docker team maintains a large number of high-quality official images together with the open source project teams, both directly in the production environment and as a basis for further customization, greatly reducing the cost of image production for application services. * * Daily picture top thousand words **! [Image.png] (https://static.studygolang.com/180117/2c39f7bfd2e42e466b7211dfc0edcb47.png) Basic Concepts in **2**docker * * MIRROR * * is a special file system, In addition to the programs, libraries, resources, configurations, and other files that are required to run the container, there are some configuration parameters that are prepared for the runtime, and the mirror does not contain any dynamic data and is not changed after the build. Tiered storage Because the image contains the full root filesystem of the operating system, the volume is often large, so in the case of Docker design, the technology of Union FS is used to design it as a tiered storage architecture. So strictly speaking, the image is not a packaged file like an ISO, mirroring is just a virtual concept, and its actual embodiment is not composed of a file, but consists of a set of file systems, or a combination of multi-tier file systems. The features of tiered storage also make it easier to reuse and customize the image. You can even use a previously built image as the base layer, and then add new layers Further to customize what you need to build a new image. * * Container **docker in the image and container are similar to "class" and "instance", mirroring is a static definition, the container is the entity of the Mirror runtime, the container can be created, started, stopped, deleted, paused. The essence of a container is a process, but unlike a process that executes directly on the host, the container process runs in its own separate namespace. So the container can have its own root file system, its own network configuration, its own process space, and even its own user ID space. Processes within a container are run in an isolated environment, and are used as if they were operating under a host-independent system. This feature makes container-encapsulated applications more secure than directly running in the host. As with mirrors, containers use tiered storage, and each container runs with mirroring as the underlying layer, creating a storage layer of the current container on it.We can call this the storage layer, also called the container storage layer, that is prepared to read and write for the container runtime. The container memory life cycle is the same as the container, and when the container dies, the storage of the container disappears, and any data stored in the container storage layer will be lost with the container's deletion. According to Docker best practices, containers should not write any data to memory, the container storage layer should remain stateless, all file writes should use the data volume, or bind the host directory, read and write in these locations, skip the network storage layer, and read and write directly to the host or network storage. It has higher performance and stability. The life cycle of a data volume is independent of the container, and the data volume does not disappear after the container dies, so the data volume is not lost after the container is deleted or rerun. * * * Warehouse * * The image can be easily run on the host after it is built, and if it is to be run on a different server, we need a service that can centrally distribute the storage image, which is the Docker Registry service. Registry can contain multiple warehouses (that is, repository), a warehouse can contain multiple tags, each tag corresponds to a mirror, usually a warehouse contains multiple versions of a software, a tag corresponding to a version of the image, we can < warehouse name > :< label > format to specify which version of this software is the image. If the label is not given, latest is used as the default label. For example, in Ubuntu image, Ubuntu is the name of the repository with different version tags, such as, 14.04, 16.04. We can specify which version of the image is required by ubuntu:14.04, or ubuntu:16.04. If the label is omitted, such as Ubuntu, it will be regarded as the Ubuntu:latest warehouse name often in the form of two-segment path, such as Jwilder/nginx-proxy, the former often means Docker Registry user name in a multi-user environment, The latter is often the corresponding software name. However, this is not absolute, depending on the specific Docker Registry software or service being used. **docker Registry Public Service * *: is open to users, allowing users to manage the image of the Registry service, generally this kind of service will allow users to upload, download the public image, provide fee services to help users manage the private image, the most commonly used Registry The public service is the official Docker Hub, which is the default Registry and has a large number of high-quality official mirrors. * * Private Docker registry**: Users can build private Registry, open-source DocThe Ker Registry image only provides a server-side implementation of the Docker Registry API that is sufficient to support Docker commands, without compromising usage. But does not include the graphical interface, as well as image maintenance, user management, access control and other advanced features. These advanced features are available in the official commercial version of Docker Trusted Registry. 206 reads
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service