sehaj/learn
Docker/Interview bank

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.

0/54 PRACTISED

54 OF 54 QUESTIONS

  1. 01
    Junior11/11 guidesMust-knowConcept

    What's the difference between an image and a container?

    Basics

  2. 02
    Junior11/11 guidesMust-knowConcept

    What is a Dockerfile, and which instructions do you use most?

    Images & Dockerfile

  3. 03
    Junior11/11 guidesMust-knowConcept

    Will you lose data when a container exits? How do you persist data?

    Data

  4. 04
    Junior11/11 guidesMust-knowConcept

    What is Docker Compose, and how is it different from a Dockerfile?

    Compose

  5. 05
    Junior10/11 guidesMust-knowConcept

    What's the difference between a container and a virtual machine?

    Basics

  6. 06
    Mid10/11 guidesMust-knowConcept

    What network types does Docker provide, and how do containers talk to each other?

    Networking

  7. 07
    Junior9/11 guidesMust-knowConcept

    Explain Docker's architecture. How do the client and the daemon communicate?

    Basics

  8. 08
    Junior9/11 guidesMust-knowConcept

    What is a Docker registry, and how do you push and pull images?

    Basics

  9. 09
    Junior8/11 guidesMust-knowConcept

    What's the difference between COPY and ADD?

    Images & Dockerfile

  10. 10
    Junior8/11 guidesMust-knowConcept

    Can a container restart itself? Explain the restart policies.

    Running containers

  11. 11
    Junior8/11 guidesMust-knowConcept

    How do you clean up unused images, containers and other Docker data? What's a dangling image?

    Production & CI

  12. 12
    Mid8/11 guidesMust-knowConcept

    How does Docker isolate containers? Explain namespaces and cgroups.

    Basics

  13. 13
    Mid8/11 guidesMust-knowDesign

    How do you secure Docker containers? Name the practices you'd apply.

    Security

  14. 14
    Mid8/11 guidesMust-knowConcept

    What's the difference between Docker and Kubernetes? Where does Docker Swarm fit?

    Production & CI

  15. 15
    Junior7/11 guidesMust-knowConcept

    What is Docker, and why do teams use it?

    Basics

  16. 16
    Junior7/11 guidesMust-knowConcept

    Describe the lifecycle of a Docker container.

    Running containers

  17. 17
    Mid7/11 guidesMust-knowConcept

    What's the difference between RUN, CMD and ENTRYPOINT?

    Images & Dockerfile

  18. 18
    Senior7/11 guidesMust-knowDesign

    How do you manage secrets like passwords and API keys with Docker?

    Security

  19. 19
    Mid6/11 guidesMust-knowConcept

    How do image layers and the build cache work, and how does instruction order matter?

    Images & Dockerfile

  20. 20
    Mid6/11 guidesMust-knowConcept

    What are multi-stage builds, and why use them?

    Images & Dockerfile

  21. 21
    Mid6/11 guidesMust-knowDesign

    How do you run the same image in development, staging and production?

    Running containers

  22. 22
    Mid6/11 guidesMust-knowConcept

    What's the difference between volumes, bind mounts and tmpfs mounts?

    Data

  23. 23
    Mid6/11 guidesGood to knowConcept

    How do you scale containers, and what limits how many can run on one host?

    Production & CI

  24. 24
    Mid6/11 guidesMust-knowDebugging

    A container exits immediately after starting, or keeps restarting. How do you debug it?

    Troubleshooting

  25. 25
    Mid5/11 guidesMust-knowScenario

    How do you reduce the size of a Docker image?

    Images & Dockerfile

  26. 26
    Mid5/11 guidesMust-knowConcept

    How do you limit a container's CPU and memory, and what happens when it exceeds them?

    Running containers

  27. 27
    Mid5/11 guidesGood to knowConcept

    What's the difference between docker exec and docker attach?

    Running containers

  28. 28
    Mid5/11 guidesGood to knowDesign

    How does logging work in Docker, and how would you handle logs in production?

    Running containers

  29. 29
    Mid5/11 guidesMust-knowDesign

    How would you use Docker in a CI/CD pipeline?

    Production & CI

  30. 30
    Junior4/11 guidesMust-knowConcept

    What's the difference between docker stop and docker kill?

    Running containers

  31. 31
    Junior4/11 guidesGood to knowConcept

    Can you write a Compose file in JSON instead of YAML?

    Compose

  32. 32
    Mid4/11 guidesMust-knowConcept

    Why do containers need health checks, and what does Docker do with them?

    Running containers

  33. 33
    Mid4/11 guidesGood to knowConcept

    How do you share data between containers?

    Data

  34. 34
    Mid4/11 guidesGood to knowScenario

    How does a container reach a service running on the host machine?

    Networking

  35. 35
    Senior4/11 guidesGood to knowDesign

    How would you monitor Docker containers in production?

    Production & CI

  36. 36
    Junior3/11 guidesMust-knowConcept

    What's the difference between EXPOSE and publishing a port with -p?

    Networking

  37. 37
    Mid3/11 guidesGood to knowConcept

    Walk me through what happens when you run docker run nginx.

    Basics

  38. 38
    Mid3/11 guidesGood to knowConcept

    What's the difference between the exec form and the shell form of CMD?

    Images & Dockerfile

  39. 39
    Mid3/11 guidesGood to knowConcept

    What is the build context, and what is .dockerignore for?

    Images & Dockerfile

  40. 40
    Mid3/11 guidesMust-knowConcept

    Why is the latest tag considered risky? What should you use instead?

    Images & Dockerfile

  41. 41
    Mid3/11 guidesGood to knowConcept

    How do you move an image to another machine without a registry? What's the difference between save/load and export/import?

    Images & Dockerfile

  42. 42
    Mid3/11 guidesMust-knowDebugging

    Two containers can't reach each other by name. How do you debug it?

    Networking

  43. 43
    Mid3/11 guidesMust-knowScenario

    With Compose, how do you make sure one container starts only after another is ready?

    Compose

  44. 44
    Mid3/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

  45. 45
    Junior2/11 guidesGood to knowConcept

    What's the difference between docker run, docker start and docker exec?

    Running containers

  46. 46
    Mid2/11 guidesGood to knowConcept

    What's the difference between ARG and ENV?

    Images & Dockerfile

  47. 47
    Senior2/11 guidesGood to knowConcept

    What is rootless Docker, and why would you use it?

    Security

  48. 48
    Senior2/11 guidesGood to knowDesign

    Should you run databases and other stateful apps in Docker?

    Production & CI

  49. 49
    Mid1/11 guides · our pickMust-knowDebugging

    A container keeps exiting with code 137. What does that mean, and how do you find the cause?

    Troubleshooting

  50. 50
    Mid1/11 guides · our pickGood to knowDebugging

    Why does docker stop take ten seconds for some containers, and how do you fix it?

    Troubleshooting

  51. 51
    Mid1/11 guidesGood to knowDebugging

    You rebuilt the image, but your code changes still aren't showing up. Why?

    Troubleshooting

  52. 52
    Senior1/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

  53. 53
    Senior1/11 guides · our pickGood to knowDesign

    Is Docker Compose suitable for production? What would you change in the file?

    Compose

  54. 54
    Senior1/11 guides · our pickMust-knowScenario

    It works locally but fails in production. Where do you look?

    Troubleshooting