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.

MediumTechnical
41 practiced

In a multi-container development environment, one service can't connect to another using its service name on a Docker network, even though both containers are running (for example an API can't reach its database in a docker-compose stack). Walk through how you'd debug DNS resolution and network attachment to find the root cause, and explain the difference between the default bridge network and a user-defined network for this kind of service discovery.

EasyTechnical
36 practiced

What's the difference between an image tag (like v1.2.3 or latest) and a content-addressable digest (sha256:...)? Why would you deploy by digest in production rather than by tag, and what commands would you use to get an image's digest after pushing it and reference that exact digest when pulling or deploying?

HardTechnical
46 practiced

You inspect a running production container and notice ps aux inside it shows a growing number of <defunct> zombie processes that never clear, even though the main application appears to be working fine. Explain what PID 1 is responsible for inside a container's PID namespace that it wouldn't have to worry about as an ordinary process on a normal host, why an application binary running directly as PID 1 often fails at that responsibility, and what concrete change you'd make to the container's entrypoint to fix it. What would you gain and lose if you instead solved this by running a full init system inside the container, or by having the container share the host's PID namespace?

HardTechnical
37 practiced

A service running in a container shows intermittent high CPU usage. Describe how you'd profile and optimize CPU usage both at the application level and at the container level (cgroups, CPU limits, scheduling), naming specific tools and configuration flags you'd use.

EasyTechnical
51 practiced

Why should a container process run as non-root in production, especially one that processes sensitive data or is exposed to untrusted input? Show the Dockerfile techniques to create a non-root user and switch to it, and explain how to still allow something like binding to a privileged port below 1024 without running as root.

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.