Interview Q&A / Docker & Kubernetes
Docker & Kubernetes interview questions
Images, containers, Dockerfiles, pods and deployments, from first principles.
Prefer rapid revision? Practise Docker & Kubernetes short interview answers →
- What is Docker Compose and when would you use it?
Docker Compose lets you define a multi-container app, such as a web server, database and cache, in one YAML file and start or stop all of it with one command. It sets up a shared network so services reach each other by name, and it is mainly used for local development, testing and small single-server deployments.
BeginnerIn-depth3 min read - What is the difference between a container and a virtual machine?
A virtual machine runs a full guest operating system on virtual hardware provided by a hypervisor. A container is just an isolated process that shares the host's kernel, so it starts in seconds or less, uses far less memory, and is lighter to ship, but gives weaker isolation than a VM.
BeginnerIn-depth4 min read - What is the difference between a Docker image and a container?
An image is a read-only template that holds your app, its dependencies and a startup command. A container is a running (or stopped) instance of that image, with its own thin writable layer on top. One image can start many containers.
BeginnerIn-depth3 min read - Why is data in a container temporary, and what are Docker volumes and bind mounts?
Files a container writes go into its own writable layer, which is deleted when the container is removed. To keep data, you mount storage from outside the container. A volume is storage managed by Docker; a bind mount maps a specific folder from the host into the container.
BeginnerIn-depth3 min read