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.

HardSystem Design
44 practiced

Your organization builds dozens of services from a monorepo on distributed CI runners with poor cache locality, so Docker layer caches rarely hit and builds are slow. Design a build-cache strategy: shared base images, BuildKit remote cache export/import (--cache-from/--cache-to), cache namespacing per service, and how you'd secure and store the remote cache.

HardTechnical
46 practiced

You built an image using a multi-stage build, but at runtime the container fails with an ImportError or a missing shared library. Walk through a step-by-step debugging plan (using tools like docker history, an interactive docker run --rm -it, or dive) to find which stage or layer omitted the dependency, and how you'd fix it without bloating the final image back up.

EasyTechnical
46 practiced

What is a Dockerfile, and what do its core instructions do: FROM, RUN, COPY, ADD, ENV, ARG, CMD, ENTRYPOINT, EXPOSE, VOLUME, and HEALTHCHECK? Using a simple web service as an example, state which of these create a new image layer versus which are metadata-only, and which are evaluated at build time versus at container runtime.

HardSystem Design
51 practiced

Design a health-check strategy for a containerized service whose startup can take several minutes and whose dependencies may be temporarily unavailable. How would you configure HEALTHCHECK (start period, interval, retries) and restart policy so deployments are safe without being overly fragile, and what would you still want in logs and metrics on top of the health check itself?

HardTechnical
47 practiced

An image that used to be around 900 MB is now over 4 GB after recent changes. Walk through how you'd investigate layer by layer to find the source of the bloat, and name the most common Dockerfile or package-manager mistakes that cause images to balloon like this.

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.