What is Docker and why use it?
Quick answer
Docker packages applications and their dependencies into images and runs them as containers. It helps teams reduce differences between development and deployment environments, without promising that every host behaves identically.
Why packaging helps
Imagine a small service that requires a particular Python version and several libraries. Instead of asking each teammate to install those versions manually, the team can build an image describing that environment. Docker creates a container from the image. The host still needs a compatible container engine, kernel environment and CPU architecture. Configuration and external data may also differ. For example, the same image can contain Python 3 and the service files for both learners. Each creates a separate container; neither needs to install those libraries into the host Python environment.
Containers and virtual machines
A Linux container runs processes with isolation provided by the Linux kernel. A virtual machine normally runs its own guest kernel. Docker Desktop can run Linux containers inside a Linux VM on macOS or Windows. Containers are not automatically a strong security boundary.
Try it yourself
A teammate has a different Python version. Explain which part an image can standardize and which host requirement remains.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
What is Docker and why use it? — knowledge check
Check understanding of the lesson concepts.
Which problem can a Docker image help reduce?
What normally provides process isolation for Linux containers?