juniorDocker

What is Docker and how does it differ from a Virtual Machine?

Updated Apr 28, 2026

Short answer

Docker is a containerization platform that shares the host OS kernel, making it lightweight compared to VMs which require a full guest OS.

Deep explanation

Docker leverages Linux namespaces and cgroups to provide isolation. Unlike VMs, there is no hypervisor layer overhead, allowing for near-native performance and rapid startup times.

Real-world example

A developer wants to ensure their app runs exactly the same on their laptop as it does on a colleague's machine.

Common mistakes

  • Confusing 'EXPOSE' with port publishing ('-p').

Follow-up questions

  • What is a 'layer' in Docker?

More Docker interview questions

View all →