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.
-
1Have you seen this? stackoverflow.com/questions/16047306/…Mike Nakis– Mike Nakis2015-04-21 14:25:07 +00:00Commented Apr 21, 2015 at 14:25
-
1I'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.Doc Brown– Doc Brown2015-04-21 15:41:32 +00:00Commented Apr 21, 2015 at 15:41
2 Answers
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
-
2You should edit this to replace [[whatever]] with something readable.Matthew James Briggs– Matthew James Briggs2015-04-21 15:46:12 +00:00Commented Apr 21, 2015 at 15:46
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.