3 ms·
So some reasons people bring up for using Docker: "A full virtualized system gets its own set of resources allocated to it, and does minimal sharing. You get m
by kqr 8y ago
So some reasons people bring up for using Docker:
"A full virtualized system gets its own set of resources allocated to it, and does minimal sharing. You get more isolation, but it is much heavier (requires more resources)."
Is that really true? The few recent-ish comparisons I find between Docker and VMs indicate that services running under both perform comparably, thanks to modern advances in hardware-assisted virtualisation. (I also get the sense that people frequently use Docker on top of virtual machines.)
But if VMs do not use resources efficiently for your purposes, you can use the exact same Ansible scripts you installed the VM with to install your services onto a dedicated physical machine instead. No need to change anything.
"AuFS is a layered file system, so you can have a read only part and a write part which are merged together. One could have the common parts of the operating system as read only (and shared amongst all of your containers) and then give each container its own mount for writing."
Am I misunderstanding something if I think this is exactly how regular mount works? It's literally a layering of disks (or disk images.)
If you mount / as read-only (which is not a bad idea in general either) then you can have multiple virtual machines sharing the same base disk image.
"Regarding consistency, Docker images are immutable. It should be self-evident that it is easier to maintain something that does not change. Your config won't suddenly break because the OS updated itself."
Sure, freezing software in points of time is very easy to deal with. But what about security updates? If you are going to do updates anyway, you still have to have workflows in place to deal with changing images.
I'd also argue that if your config breaks all the time for OS update reasons, you should probably consider running a different OS in your production environment.
"the following is a speed comparison of start and stop times for the two different technologies:"
Yes, I recognise that Virtual Machines can take up to several minutes to provision, while Docker containers can be spun up in seconds. I do see how Docker is a huge deal if, at the core of your problem domain, you find "needing to spin up new instances of services in seconds but no ability to run hot spares". That sounds like a very limited domain, though.