Home  >  Q&A  >  body text

Docker和其他VM技术有什么不同?

最近发现Docker很火啊,好像所有的服务都可以放到Docker里面来跑。貌似Docker也分很多不同的系统,Docker也是一种虚拟机(VM)技术吗?我看Docker的镜像都很小,是不是一种简化的虚拟机呢?

黄舟黄舟2710 days ago800

reply all(5)I'll reply

  • 阿神

    阿神2017-04-21 10:57:51

    Docker is a so-called lightweight virtualization technology at the operating system level compared to full virtualization and paravirtualization. Traditional virtualization technology takes a very long time to generate an environment. For docker, startup and destruction are within seconds, and the underlying technology lxc (linux container) it relies on is completely a kernel feature without any middle layer overhead. The resource utilization is extremely high and the performance is close to that of a physical machine. Of course, since docker now relies on lxc, you can only run it on Linux (now mac osx also supports it, but it just uses virtualbox to create a Linux virtual machine. Believe me, there is no need to use it on mac now. Meaning, even for docker development, I think vagrant is more suitable. I just tried the boot2docker mac tool yesterday and the experience was really bad).

    The so-called different systems mentioned by the subject are actually images maintained by docker. This is not necessary for lxc, but docker maintains this set of images to make it easier to save the application environment and achieve dependency-free environment distribution. In addition, it is not accurate that the docker images you said are very small. The size of the docker image is determined by the application. You can make your image save anything, which means it can be of any size.

    Docker is not suitable for everything. At present, it is not suitable. For billing tasks with high precision requirements, docker is not suitable, but it is enough for ordinary PaaS. Moreover, docker is currently developing very rapidly. I believe that the features will be enhanced. It will be soon.

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-21 10:57:51

    Docker is an application container. You can think of it as a container, which packages the entire environment including applications and application dependencies together. This makes installation and deployment easy, and each developer uses the same container. version, you won’t run into pitfalls because you depend on different versions, and you don’t have to worry about maintaining the version yourself.

    On 64-bit Linux, Docker does not use a virtual machine, so the performance is very good. On systems other than 64-bit Linux systems (including Windows, Mac OS X), Docker utilizes virtual machine technology.

    reply
    0
  • 黄舟

    黄舟2017-04-21 10:57:51

    Docker achieves PAAS, which is platform as a service. Docker uses lxc kernel virtualization on 64-bit Linux, which is lightweight virtualization. Compared with VM, it does not need to simulate the hardware and can share the same operations as the host. system, and has AUFS and lXC for virtualization. Adding an ubuntu image is 265MB. If you want to create 1,000 new VM hosts, you will need 265,000MB of memory, but the docker shared capacity will only need a little more than 256. If you run on Linux VMware believes that you will notice that the host memory consumption is relatively large. An Amazon EC2 512MB memory single-core cloud host can run 5 dockers without any pressure. If you run 5 vmware, it will be very laborious

    reply
    0
  • PHPz

    PHPz2017-04-21 10:57:51

    An article I saw before was very detailed.
    http://tiewei.github.io/cloud/Docker-Getting-Start/

    reply
    0
  • 阿神

    阿神2017-04-21 10:57:51

    Docker is based on LXC, which is a process-level virtualization solution. From the perspective of the host machine, each running Docker is a process.

    Xen/OpenVZ are system-level virtualization solutions. From the perspective of the host machine, each virtual machine is allowed.

    Here is a more detailed comparison: http://goldmann.fedorapeople.org/tmp/docker-preso/#/5

    reply
    0
  • Cancelreply