Containerization and Docker Fundamentals Questions

Packaging applications into containers: images and layers, Dockerfiles, registries, image optimization and security, container networking and storage, and the container runtime model. Covers how containers differ from virtual machines, image build and management, and the fundamentals that underpin any orchestration platform. The container primitive before orchestration.

EasyTechnical
48 practiced

How do you set CPU and memory limits for a Docker container, both at runtime (--memory, --cpus, --memory-swap) and in Compose? Why do these limits matter for reliability when many containers share a host, and what's the practical difference between limiting resources in Docker versus relying on the host OS alone?

MediumTechnical
71 practiced

How do you make Docker image builds reproducible, so the same source and dependencies produce an equivalent image weeks or months later? Discuss lockfiles, pinning base images by digest instead of a tag, avoiding latest in build args, and how you'd verify reproducibility (hashes, binary diffs) and respond when a previously-reproducible build breaks.

MediumTechnical
52 practiced

For a stateful database service, would you use a named Docker volume or a host bind mount in development versus in production, and why? Discuss portability, performance, backup strategy, and permission issues you might hit (including SELinux on some Linux hosts).

MediumTechnical
49 practiced

A containerized service doesn't shut down cleanly during deployments and leaves requests hanging for several seconds. Walk through how you'd investigate PID 1 behavior, signal handling, and graceful termination in Docker to find the cause.

HardTechnical
39 practiced

You're asked to harden a container image that currently runs as root, ships shell utilities, and is built from a large general-purpose base image, exposing an API to untrusted input. Propose a runtime hardening policy: seccomp profiles, dropping Linux capabilities, a read-only root filesystem, rootless containers, and how you'd enforce and audit these at deploy time, while keeping the service actually operable.

Unlock Full Question Bank

Get access to all Containerization and Docker Fundamentals interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.