2

I hear a fair amount of people using Docker these days, and I am wondering where they execl compared to virtual machines, and when a virtual machine would be a more suitable choice.

2
  • 1
    Have you seen this? stackoverflow.com/questions/16047306/… Commented Apr 21, 2015 at 14:25
  • 1
    I'm voting to close this question as off-topic because is it not about conceptual software development. Maybe its better suited for superuser or serverfault. Commented Apr 21, 2015 at 15:41

2 Answers 2

7

Docker allows you to easily create and distribute an environment. You can keep the environment identical on all systems. You can make snapshots of these images and docker will pull them down, and [[whatever]] in them the same on all systems.

It is considerably easier to keep this image the same across all users than a VM. It's also considerably more lightweight than a VM both in terms of resources required as well as size.

Virtual machines, however, are slower to startup and also much easier to have differences. They are normally larger as they require a full OS (docker does much less). You have updates and custom installations of software and user settings and all other types of things which may change your "consistent" image.

Some examples:

  • If you are just looking for a repeatable test environment, it's likely you want to use docker
  • If you want to test kernel functionality, don't use docker - it shares this with the host OS
  • If you need to spin up 100s of these for your [[whatever]], probably use docker, as it's much faster
  • If you need to dedicate resources to your [[whatever]], use a VM as docker is not guaranteed
1
  • 2
    You should edit this to replace [[whatever]] with something readable. Commented Apr 21, 2015 at 15:46
1

Unless I am mistaken, one of the biggest reasons to use a Virtual Machine is to virtualize an OS that is different than the hos on. Windows Host -> Linux VM or Linux Host -> BSD VM etc.

It is my understanding that the strength of containers is that that they make use of the underlying host system to reduce requirements. So, if you are using a container, you are basically running a limited instance of your main machine.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.