Containers
Docker
Docker made containers practical: package an application with its runtime and dependencies into an image, and run it the same way on a laptop, a CI agent, or an EKS node. Most DevOps engineers use it every day; senior interviews go underneath the commands — how images and layers are stored, what a container actually is to the kernel, how BuildKit caching works, how networking is wired with veth pairs and iptables, and how to build images that are small, reproducible and secure enough for a regulated production environment.
After this topic you can
- Write small, secure, cache-friendly Dockerfiles
- Run, inspect and debug containers
- Explain images, layers, volumes and container networking
Lessons
-
1Containers, VMs and the Docker architecture
- What a container really is
- Containers vs virtual machines
- The engine stack
- OCI standards and Kubernetes
-
2Images, layers and registries
- Layers and the union filesystem
- Tags, digests and manifests
- Registries and naming
-
3Writing Dockerfiles properly
- The instructions
- ENTRYPOINT vs CMD
- Exec form vs shell form
- Build context and .dockerignore
- How layer caching decides
-
4BuildKit, multi-stage builds and CI caching
- Multi-stage builds
- BuildKit features worth knowing
- Never put secrets in images
- Reproducible builds
-
5Running containers: lifecycle, resources and logs
- Lifecycle
- Restart policies
- Resource limits
- Init and signals
- Logging
-
6Storage and data
- Three ways to mount data
- The container's writable layer
- Databases in containers
- Disk housekeeping
-
7Networking internals
- Bridge networking, step by step
- Network drivers
- DNS between containers
- Subnet clashes
-
8Container security
- Defence in depth
- Supply chain security
- Debugging minimal images
-
9ECR and registry operations
- Pushing to ECR
- Repository settings to mention
- Tagging strategy
-
10Troubleshooting Docker
- Common failures and fixes
- A debugging sequence
-
11Interview questions and model answers
- "How would you make a Docker image smaller, faster to build and more secure?"
- "What's the difference between CMD and ENTRYPOINT, and why does exec form matter?"
- "Explain how a container is isolated."
- "Your container works on your laptop but fails on an EKS node with exec format error. Why?"
- "How does layer caching work and how would you speed up a slow CI build?"
- "Where are secrets safe in a Docker workflow?"
- "A host's disk keeps filling up with Docker data. What do you do?"
- "Why tag with the git SHA instead of latest?"
- "Docker vs containerd vs runc?"