Docker Interview Questions
3 questions for junior and mid-level Docker interviews, with model answers, code examples and common mistakes. Answer each one out loud first, then reveal the answer.
Docker Container Basics
// interview question
What is the difference between a Docker image and a container? How do they relate to each other?
Answer out loud first, then check yourself against the model answer.
Dockerfile Best Practices
// interview question
What is the difference between a Docker image and a container? What are some Dockerfile best practices?
Answer out loud first, then check yourself against the model answer.
Docker Image Layers and Caching
// interview question
How do Docker image layers work, and how can you optimize your Dockerfile to take advantage of layer caching?
Answer out loud first, then check yourself against the model answer.
More interview topics
Also worth your time on this topic
Difference Between RUN, CMD and ENTRYPOINT in a Dockerfile
RUN executes at build time, CMD sets the default command, and ENTRYPOINT sets the program that always runs. See how the three combine, why a container exits at once, how to run cron, when ADD beats COPY, and how comments work in a Dockerfile.
Docker Multi-Stage Build Optimization
Learn to create efficient Docker images using multi-stage builds to reduce image size and improve security.
60 minutes
Docker Security Hardening Checklist
Comprehensive security checklist for hardening Docker containers, images, and runtime environments.
60-90 minutes