Back to the Catalog
docker
containers
devops
linux
networking

Docker: What Actually Happens?

36 questions

Test what Docker does with build contexts, caching, image layers, multi-stage builds, Unix signals, networking, storage, and Linux isolation. Each Question asks you to reason through a concrete situation.

Questions

  1. Not answered. Can COPY reach a sibling directory outside the build context?
  2. Not answered. What happens when .dockerignore excludes a file that COPY requests?
  3. Not answered. Which ignore file controls a build when both applicable files exist?
  4. Not answered. Why does COPY main.c /src/ fail when the Dockerfile is piped as the build context?
  5. Not answered. Does touching a copied file invalidate its build cache?
  6. Not answered. Which changes can invalidate the cache for COPY package.json /app/?
  7. Not answered. Why can RUN apt-get update return week-old data during a rebuild?
  8. Not answered. Which Dockerfile order keeps the dependency cache when application source changes?
  9. Not answered. What must be true of a build that uses RUN --mount=type=cache?
  10. Not answered. How should you pass a private registry token to one build step?
  11. Not answered. Does rotating a build secret automatically invalidate the consuming RUN cache?
  12. Not answered. Which build-stage files end up in the final image?
  13. Not answered. Which image does docker build --target test . produce?
  14. Not answered. Why can deleting a 200 MB archive in a later RUN leave the image roughly 200 MB larger?
  15. Not answered. Where does a running container write /etc/app.conf when the file came from its image?
  16. Not answered. What can happen when an OverlayFS-backed container changes one byte in a large image file for the first time?
  17. Not answered. Which image reference guarantees the same published image content on later pulls?
  18. Not answered. Why might ENTRYPOINT node server.js hide Docker's stop signal from Node?
  19. Not answered. What does docker stop do when the main process does not exit during its grace period?
  20. Not answered. By default, how many seconds does Docker wait before killing an unresponsive Linux container?
  21. Not answered. Why would you use docker run --init?
  22. Not answered. What does EXPOSE 8080 do by itself?
  23. Not answered. Where does traffic to host port 8080 go with docker run -p 8080:80 nginx?
  24. Not answered. Who can potentially reach -p 8080:80 when no host IP is specified?
  25. Not answered. How should web connect to db on the same user-defined bridge?
  26. Not answered. What does localhost mean inside the web container?
  27. Not answered. Must a database port be published for a peer on the same user-defined bridge to reach it?
  28. Not answered. What happens to a named volume after the container using it is removed?
  29. Not answered. What initially appears in a new empty volume mounted over a non-empty image directory?
  30. Not answered. What does a default read-write bind mount over /app do?
  31. Not answered. What happens to files in a Docker tmpfs mount when the container stops?
  32. Not answered. What happens to database files written only into a container's writable layer after that container is deleted?
  33. Not answered. Which statements accurately describe default Linux container isolation?
  34. Not answered. Without resource limits, how much CPU and memory can a container use?
  35. Not answered. With these limits, how many megabytes of swap can the container use?
  36. Not answered. What does Docker's default seccomp profile do on a supported Linux host?