What is the difference between a virtual machine and a container?
Answer
- A VM simulates a full computer with its own operating system. It is heavier and slower to start.
- A container packages only the app and its dependencies, and shares the host's operating system kernel. It is lighter and starts quickly.
- Use VMs for strong isolation or different operating systems; use containers to ship and scale apps consistently.
- They are often combined: containers running inside cloud VMs.
Practice this question in Repaso