docker learning 1

Docker project's goal is to achieve a lightweight operating system virtualization solution. Docker is the foundation of Linux containers (LXC) technology. On the basis of the LXC Docker was further package, so users do not need to care about container management, making the operation easier. User Action Docker containers just as you do a fast lightweight virtual machine is as simple as

docker and virtual machine difference:

VM: each virtual machine, including applications, the necessary binaries and libraries, as well as a complete user operation subsystem

docker: through the container technology and our shared host hardware and operating system resources, dynamic allocation of resources. Docker belongs Linux package container, the container provides an easy to use interface. It is the most popular Linux container solutions. And Linux is a Linux container developed another virtualization technology, simple terms, Linux container is not a complete simulation of the operating system, but the process of isolation, the equivalent outside the normal process sets up a protective layer. For container inside the process, it is exposed to a variety of virtual resources, enabling the isolation of the underlying system. Docker application and dependence of the program, which is packaged in a file. This file is run, it will generate a virtual container. Running in the virtual container, just like running on a real physical machine. With Docker, do not worry about environmental issues.

Docker's three concepts:

Image (Mirror), Container (container), Repository (warehouse) Mirroring is a prerequisite for running Docker containers, warehouse storage sites mirror, the mirror can be seen is the core of Docker.

Mirror: Docker image can be seen as a special file system, in addition to providing the desired containers run programs, libraries, resources, configuration files, etc., but also contains a number of configuration parameters to prepare for the operation (such as anonymous volume, environment variables, users, etc.). Image does not contain any dynamic data, the contents of which can not be changed after the construct. Image (Image) is a pile layer read-only (read-only layer) unified perspective, perhaps this definition is somewhat difficult to understand, this chart below can help the reader understand the definition of the mirror:

This is probably the most detailed entry summary Docker vomiting blood

 

 

从左边我们看到了多个只读层,它们重叠在一起。除了最下面一层,其他层都会有一个指针指向下一层。这些层是 Docker 内部的实现细节,并且能够在主机的文件系统上访问到。统一文件系统(Union File System)技术能够将不同的层整合成一个文件系统,为这些层提供了一个统一的视角。这样就隐藏了多层的存在,在用户的角度看来,只存在一个文件系统。我们可以在图片的右边看到这个视角的形式。镜像可以用来创建 Docker 容器,一个镜像可以创建很多容器。Docker 提供了一个很简单的机制来创建镜像或者更新现有的镜像,用户甚至可以直接从其他人那里下载一个已经做好的镜像来直接使用。

仓库:

仓库(Repository)是集中存放镜像文件的场所。有时候会把仓库和仓库注册服务器(Registry)混为一谈,并不严格区分。实际上,仓库注册服务器上往往存放着多个仓库,每个仓库中又包含了多个镜像,每个镜像有不同的标签(tag)。仓库分为公开仓库(Public)和私有仓库(Private)两种形式。最大的公开仓库是 Docker Hub,存放了数量庞大的镜像供用户下载。国内的公开仓库包括 时速云 、网易云 等,可以提供大陆用户更稳定快速的访问。当然,用户也可以在本地网络内创建一个私有仓库。当用户创建了自己的镜像之后就可以使用 push 命令将它上传到公有或者私有仓库,这样下次在另外一台机器上使用这个镜像时候,只需要从仓库上 pull 下来就可以了。Docker 仓库的概念跟 Git 类似,注册服务器可以理解为 GitHub 这样的托管服务。

容器:Docker 利用容器(Container)来运行应用。容器是从镜像创建的运行实例。它可以被启动、开始、停止、删除。每个容器都是相互隔离的、保证安全的平台。可以把容器看做是一个简易版的 Linux 环境(包括root用户权限、进程空间、用户空间和网络空间等)和运行在其中的应用程序。

And the container defines a mirror almost exactly the same unified perspective is a pile layer, the only difference is that the uppermost layer of the container that is readable and writable. + = Read image layer container

container ufs

A running state of the container is defined as a unified file system read-write plus isolation process space therein and comprising process. Here's a picture showing a container operation.

container running

It makes Docker file system isolation technology has become a very promising virtualization technology. A container process might file to modify, delete, create, these changes will be applied to the read-write layer.

 

 

Guess you like

Origin www.cnblogs.com/icat-510/p/10939393.html