Containers in practice
Docker Interview Questions
Images, layers, networking, volumes, security and the Docker decisions that matter in production.
40 questions10 easy22 medium8 hard0/40 learned
01What is Docker and what problem does it solve?Easydocker · containers · packaging02How do containers compare to virtual machines?Easycontainers · virtual machines · isolation03Explain the Docker architecture and its main components.Mediumarchitecture · daemon · containerd04What is the difference between an image and a container?Easyimages · containers · immutability05How do you write a Dockerfile?Easydockerfile · build · images06How do image layers and build caching work?Mediumlayers · caching · build07What are multi-stage builds and when do you use them?Mediummulti-stage · image-size · build08What is the Docker build context and why does it matter?Mediumbuild context · build · performance09What does .dockerignore do and what should go in it?Mediumdockerignore · build context · security10What is the difference between ENTRYPOINT and CMD?Mediumentrypoint · cmd · signals11How should you configure containers with environment variables?Easyconfiguration · environment variables · 12-factor12What are Docker volumes and when should you use them?Easyvolumes · persistence · storage13When would you use a bind mount instead of a volume?Mediumbind mounts · development · storage14How does Docker networking work?Mediumnetworking · bridge · dns15How does port mapping work in Docker?Easyports · networking · exposure16What is Docker Compose and what is it good for?Easycompose · local development · orchestration17When would you use Compose versus Kubernetes?Mediumcompose · kubernetes · orchestration18Describe the container lifecycle and restart policies.Mediumlifecycle · restart policy · shutdown19How should you collect and manage container logs?Mediumlogs · observability · logging drivers20How do you debug a container that is failing?Mediumdebugging · troubleshooting · exec21What are healthchecks and how do you use them?Mediumhealthchecks · readiness · reliability22How do you apply CPU and memory limits to containers?Hardresource limits · cgroups · oom23How do you reduce Docker image size?Mediumimage size · base images · build24How do you secure a container image?Hardimage security · scanning · supply chain25How do container registries work and how do you use them safely?Mediumregistries · distribution · authentication26What image tagging strategy would you use?Mediumtags · versioning · release27How do you harden a container at runtime?Hardsecurity · capabilities · hardening28Why and how should containers run as non-root?Mediumnon-root · users · security29How do you handle secrets in Docker builds and at runtime?Hardsecrets · buildkit · security30How do you handle persistent data in containers?Mediumpersistence · stateful · volumes31How do you build and publish images in CI?Mediumci · buildx · automation32What does BuildKit add over the classic Docker builder?Hardbuildkit · build · caching33How do you build images for multiple CPU architectures?Hardmulti-platform · buildx · arm6434How does traffic flow between containers and the outside world?Hardnetworking · nat · dns35How do you put a reverse proxy in front of containers?Mediumreverse proxy · tls · nginx36What would you monitor for containers in production?Mediummonitoring · metrics · observability37How do you back up data stored in Docker volumes?Mediumbackup · restore · volumes38What are common Docker mistakes you have seen?Easyanti-patterns · review · production39What would you check before running Docker in production?Hardproduction · readiness · operations40What Docker best practices do you follow?Easybest practices · dockerfile · operations
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Docker mock interview and get scored feedback on depth, clarity and confidence.