How is Docker different from a virtual machine?

前端 未结 20 2691
闹比i
闹比i 2020-11-21 22:36

I keep rereading the Docker documentation to try to understand the difference between Docker and a full VM. How does it manage to provide a full filesystem, isolated network

20条回答
  •  花落未央
    2020-11-21 23:16

    There are a lot of nice technical answers here that clearly discuss the differences between VMs and containers as well as the origins of Docker.

    For me the fundamental difference between VMs and Docker is how you manage the promotion of your application.

    With VMs you promote your application and its dependencies from one VM to the next DEV to UAT to PRD.

    1. Often these VM's will have different patches and libraries.
    2. It is not uncommon for multiple applications to share a VM. This requires managing configuration and dependencies for all the applications.
    3. Backout requires undoing changes in the VM. Or restoring it if possible.

    With Docker the idea is that you bundle up your application inside its own container along with the libraries it needs and then promote the whole container as a single unit.

    1. Except for the kernel the patches and libraries are identical.
    2. As a general rule there is only one application per container which simplifies configuration.
    3. Backout consists of stopping and deleting the container.

    So at the most fundamental level with VMs you promote the application and its dependencies as discrete components whereas with Docker you promote everything in one hit.

    And yes there are issues with containers including managing them although tools like Kubernetes or Docker Swarm greatly simplify the task.

提交回复
热议问题