简体   繁体   English

Docker 对比虚拟机

[英]Docker vs Virtual Machine

I have read documents that are about dockers and VMs.I guess that our environments like that dev,prod run on virtual machines in a server.Each of them runs on different virtual machine but single computer(server).Also,each virtual machine contains docker.Every docker contains containers.In this containers, application image file is hold.For example;我已经阅读了关于码头工人和虚拟机的文件。我猜想我们的环境像 dev,prod 在服务器中的虚拟机上运行。它们中的每一个都在不同的虚拟机上运行,但只有一台计算机(服务器)。此外,每个虚拟机都包含docker。每个docker包含容器。在这个容器中,应用程序图像文件被保存。例如; in virtual machineB,containerB includes image for our application.Am i right?在虚拟机 B 中,容器 B 包含我们应用程序的图像。我说得对吗?

Can a docker contains many containers?一个 docker 可以包含多个容器吗? Why we need many containers in a docker?为什么我们在一个 docker 中需要很多容器? Can anyone explain docker,virtual machine,environments and image files?How these enviroments runs server?谁能解释一下docker,虚拟机,环境和镜像文件?这些环境如何运行服务器?

From https://www.docker.com/what-container : A container image is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it.来自https://www.docker.com/what-container :容器镜像是一个轻量级的、独立的、可执行的 package 软件,包括运行它所需的一切。

Docker is the service to run multiple containers on a machine (node) which can be on a vitual machine or on a physical machine. Docker 是在一台机器(节点)上运行多个容器的服务,可以在虚拟机上,也可以在物理机上。

A virtual machine is an entire operating system (which normally is not lightweight).虚拟机是一个完整的操作系统(通常不是轻量级的)。

If you have multiple applications and those require different configurations which are in conflict with each other you can either deploy them on different machines or on the same machine using docker containers, because containers are isolated from each other.如果您有多个应用程序,并且这些应用程序需要不同的配置,这些配置相互冲突,您可以将它们部署在不同的机器上,或者使用 docker 容器将它们部署在同一台机器上,因为容器彼此隔离。

So in short containers can make your application deployment and management easier.所以简而言之,容器可以使您的应用程序部署和管理更加容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM