What are the problems when the docker container is used as a virtual machine?

while learning docker, I keep hearing people emphasize that docker cannot be used as a virtual machine.
it is also not recommended to use containers as virtual machines.

but recently it has been found that someone is going to use the container as a virtual machine, and it is very likely that they will need to use the container as a virtual machine in the future.
I opposed this use at first, but later found no reason to object.

so. What are the problems when the container is used as a virtual machine? why don"t you recommend it?

Nov.25,2021

docker itself is the use of virtual technology, the pursuit is to reduce the dependence on services, mainly portable, can be used as a virtual machine is not recommended, if you install too many things in the container violates the principle of lightweight, I believe you also found in the process of use, the image downloaded by docker is basically a basic image, will not take up too much computer resources. I hope my personal understanding will be helpful to you


can docker be used as a virtual machine?
can the induction cooker be used as a gas stove?

I think the answers to these two questions are similar. To answer them, we must limit the conditional scenarios. If your pot is that kind of hemispheric pot, of course not.
therefore, it is more important to understand that induction cookers and gas stoves are only two options, and so are docker and virtual machines

in short,
docker: multiple containers share HOST OS, 'light' virtualization
virtual machines: each VM has its own HyperVisor,' heavy 'virtualization between GUEST OS,GUEST OS and HOST OS

so if your application is only running in user space and you want to make it easy to deploy, then docker is better;
conversely, if your application needs to work with, for example, kernel modules or needs to run on a different OS, then choose a virtual machine.

Menu