Docker · Containers in practice

What is Docker and what problem does it solve?

EasydockercontainerspackagingUpdated Oct 2026
Quiz this track

Short answer

Docker packages an application with its dependencies into an image and runs it as an isolated container. It removes most environment drift between development, CI and production.

Docker builds an image from a Dockerfile, stores it in a registry, and starts containers from it. The image contains the application binary, runtime, libraries and configuration defaults, so the same artifact can run on a laptop, in CI and on a server.

sh
docker build -t api:1.0.0 .
docker run --rm -p 3000:3000 api:1.0.0
The image is built once and the same tag is what gets tested and deployed.

What it actually gives you

  • A repeatable artifact instead of a list of manual install steps
  • Process isolation for CPU, memory, filesystem and network namespaces
  • Higher density and faster startup than a virtual machine
  • A common contract for CI, local development and deployment

The trade-off is that containers share the host kernel. Isolation is weaker than a VM, the host kernel version matters, and a container that needs a different kernel or kernel module cannot run. Docker also does not solve configuration, secrets or data persistence by itself.

A container is a normal Linux process with namespaces and cgroups applied. It is not a lightweight VM, and treating it as a security boundary is a common mistake.

Follow-ups you should expect

Interviewers use these to check whether the first answer was understanding or memorisation.

  1. 1What is the difference between an image and a running container?
  2. 2How does a container differ from a virtual machine?
  3. 3What parts of the host does a container still share?
  4. 4When would Docker be a poor fit for a workload?

Say it in the interview

Docker packages an application and its dependencies into an image, then runs that image as an isolated process called a container. I use it to make builds repeatable and to keep development, CI and production on the same artifact. The main trade-off is that containers share the host kernel, so isolation is weaker than a VM and kernel-specific workloads are a poor fit.

Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.

Related questions

Reading is step one

Now say it out loud.

Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Docker mock interview and get scored feedback on depth, clarity and confidence.