Interview bank · 54 questions
Docker interview questions, ranked by how often they're asked.
We read 11 of the most widely used Docker interview guides and counted which questions each one includes. 14 questions appear in at least 8 of them. Every question has a model answer written for this course, likely follow-ups, and a link to the lesson that teaches it.
How this list was made
In November 2026 we collected every question from the guides below and grouped questions that ask the same thing in different words. A question's frequency is the number of guides that include it: ●●●● means 8 or more of 11, ●●● 5 to 7, ●● 3 to 4, ● fewer. Guides aren't interviews, so treat it as a strong signal of what interviewers draw on, not a record of real interviews.
Questions marked our pick appear in few guides but come up in real work and in senior interviews, so we added them. The answers are our own; none are copied from the guides.
- InterviewBit 35 questions
- GeeksforGeeks 71 questions
- Simplilearn 35 questions
- Edureka 50 questions
- DataCamp 26 questions
- Dataquest 35 questions
- KodeKloud 30 questions
- Linux Handbook 28 questions
- Guru99 43 questions
- Turing 110 questions
- devops-exercises (GitHub) 143 questions
54 OF 54 QUESTIONS
- 01Junior11/11 guidesMust-knowConcept
What's the difference between an image and a container?
Basics
- 02Junior11/11 guidesMust-knowConcept
What is a Dockerfile, and which instructions do you use most?
Images & Dockerfile
- 03Junior11/11 guidesMust-knowConcept
Will you lose data when a container exits? How do you persist data?
Data
- 04Junior11/11 guidesMust-knowConcept
What is Docker Compose, and how is it different from a Dockerfile?
Compose
- 05Junior10/11 guidesMust-knowConcept
What's the difference between a container and a virtual machine?
Basics
- 06Mid10/11 guidesMust-knowConcept
What network types does Docker provide, and how do containers talk to each other?
Networking
- 07Junior9/11 guidesMust-knowConcept
Explain Docker's architecture. How do the client and the daemon communicate?
Basics
- 08Junior9/11 guidesMust-knowConcept
What is a Docker registry, and how do you push and pull images?
Basics
- 09Junior8/11 guidesMust-knowConcept
What's the difference between COPY and ADD?
Images & Dockerfile
- 10Junior8/11 guidesMust-knowConcept
Can a container restart itself? Explain the restart policies.
Running containers
- 11Junior8/11 guidesMust-knowConcept
How do you clean up unused images, containers and other Docker data? What's a dangling image?
Production & CI
- 12Mid8/11 guidesMust-knowConcept
How does Docker isolate containers? Explain namespaces and cgroups.
Basics
- 13Mid8/11 guidesMust-knowDesign
How do you secure Docker containers? Name the practices you'd apply.
Security
- 14Mid8/11 guidesMust-knowConcept
What's the difference between Docker and Kubernetes? Where does Docker Swarm fit?
Production & CI
- 15Junior7/11 guidesMust-knowConcept
What is Docker, and why do teams use it?
Basics
- 16Junior7/11 guidesMust-knowConcept
Describe the lifecycle of a Docker container.
Running containers
- 17Mid7/11 guidesMust-knowConcept
What's the difference between RUN, CMD and ENTRYPOINT?
Images & Dockerfile
- 18Senior7/11 guidesMust-knowDesign
How do you manage secrets like passwords and API keys with Docker?
Security
- 19Mid6/11 guidesMust-knowConcept
How do image layers and the build cache work, and how does instruction order matter?
Images & Dockerfile
- 20Mid6/11 guidesMust-knowConcept
What are multi-stage builds, and why use them?
Images & Dockerfile
- 21Mid6/11 guidesMust-knowDesign
How do you run the same image in development, staging and production?
Running containers
- 22Mid6/11 guidesMust-knowConcept
What's the difference between volumes, bind mounts and tmpfs mounts?
Data
- 23Mid6/11 guidesGood to knowConcept
How do you scale containers, and what limits how many can run on one host?
Production & CI
- 24Mid6/11 guidesMust-knowDebugging
A container exits immediately after starting, or keeps restarting. How do you debug it?
Troubleshooting
- 25Mid5/11 guidesMust-knowScenario
How do you reduce the size of a Docker image?
Images & Dockerfile
- 26Mid5/11 guidesMust-knowConcept
How do you limit a container's CPU and memory, and what happens when it exceeds them?
Running containers
- 27Mid5/11 guidesGood to knowConcept
What's the difference between
docker execanddocker attach?Running containers
- 28Mid5/11 guidesGood to knowDesign
How does logging work in Docker, and how would you handle logs in production?
Running containers
- 29Mid5/11 guidesMust-knowDesign
How would you use Docker in a CI/CD pipeline?
Production & CI
- 30Junior4/11 guidesMust-knowConcept
What's the difference between
docker stopanddocker kill?Running containers
- 31Junior4/11 guidesGood to knowConcept
Can you write a Compose file in JSON instead of YAML?
Compose
- 32Mid4/11 guidesMust-knowConcept
Why do containers need health checks, and what does Docker do with them?
Running containers
- 34Mid4/11 guidesGood to knowScenario
How does a container reach a service running on the host machine?
Networking
- 35Senior4/11 guidesGood to knowDesign
How would you monitor Docker containers in production?
Production & CI
- 36Junior3/11 guidesMust-knowConcept
What's the difference between
EXPOSEand publishing a port with-p?Networking
- 37Mid3/11 guidesGood to knowConcept
Walk me through what happens when you run
docker run nginx.Basics
- 38Mid3/11 guidesGood to knowConcept
What's the difference between the exec form and the shell form of CMD?
Images & Dockerfile
- 39Mid3/11 guidesGood to knowConcept
What is the build context, and what is
.dockerignorefor?Images & Dockerfile
- 40Mid3/11 guidesMust-knowConcept
Why is the
latesttag considered risky? What should you use instead?Images & Dockerfile
- 41Mid3/11 guidesGood to knowConcept
How do you move an image to another machine without a registry? What's the difference between
save/loadandexport/import?Images & Dockerfile
- 42Mid3/11 guidesMust-knowDebugging
Two containers can't reach each other by name. How do you debug it?
Networking
- 43Mid3/11 guidesMust-knowScenario
With Compose, how do you make sure one container starts only after another is ready?
Compose
- 44Mid3/11 guidesGood to knowScenario
How do you update a container to a new image version, or move it to a new server, without losing data?
Production & CI
- 45Junior2/11 guidesGood to knowConcept
What's the difference between
docker run,docker startanddocker exec?Running containers
- 46Mid2/11 guidesGood to knowConcept
What's the difference between ARG and ENV?
Images & Dockerfile
- 47Senior2/11 guidesGood to knowConcept
What is rootless Docker, and why would you use it?
Security
- 48Senior2/11 guidesGood to knowDesign
Should you run databases and other stateful apps in Docker?
Production & CI
- 49Mid1/11 guides · our pickMust-knowDebugging
A container keeps exiting with code 137. What does that mean, and how do you find the cause?
Troubleshooting
- 50Mid1/11 guides · our pickGood to knowDebugging
Why does
docker stoptake ten seconds for some containers, and how do you fix it?Troubleshooting
- 51Mid1/11 guidesGood to knowDebugging
You rebuilt the image, but your code changes still aren't showing up. Why?
Troubleshooting
- 52Senior1/11 guides · our pickGood to knowDebugging
Your Mac-built image fails on a server with
exec format error. Why, and how do you build images for several CPU architectures?Images & Dockerfile
- 53Senior1/11 guides · our pickGood to knowDesign
Is Docker Compose suitable for production? What would you change in the file?
Compose
- 54Senior1/11 guides · our pickMust-knowScenario
It works locally but fails in production. Where do you look?
Troubleshooting