Docker Interview Questions

Images, containers, Dockerfile best practices, multi-stage builds, volumes, networking, security, and health checks.

DockerfileNetworkingStorageSecurityBest PracticesAria-powered explanations
0 / 100 answered
0%
17 Easy48 Medium35 Hard

Showing 120 of 100

#1What is Docker and how does it differ from a VM?

Easy
Fundamentals

#2What is the difference between a Docker image and a container?

Easy
Fundamentals

#3Explain the difference between CMD and ENTRYPOINT in a Dockerfile.

Medium
Dockerfile

#4What is a multi-stage build and why is it important?

Medium
Best Practices

#5What are Docker volumes and when would you use bind mounts instead?

Medium
Storage

#6Explain Docker networking modes.

Medium
Networking

#7How do you reduce Docker image size?

Medium
Best Practices

#8How does Docker layer caching work?

Medium
Dockerfile

#9What is Docker Compose and when would you use it?

Easy
Compose

#10How does Docker handle secrets?

Hard
Security

#11What is a Docker health check?

Medium
Operations

#12What is the Docker daemon and how does it work?

Hard
Internals

#13What is container security hardening?

Hard
Security

#14How do you handle logging in Docker containers?

Medium
Operations

#15What is the difference between docker stop and docker kill?

Medium
Operations

#16What is BuildKit and how does it improve Docker builds?

Hard
Best Practices

#17How do you debug a running Docker container?

Medium
Operations

#18What is Docker Swarm and how does it compare to Kubernetes?

Medium
Orchestration

#19What are Docker labels and how are they used?

Easy
Operations

#20How does Docker's overlay filesystem work?

Hard
Internals

Showing 120 of 100

Ask Aria about Docker

Sign in to chat with Aria

All 100 Docker questions at a glance
  1. What is Docker and how does it differ from a VM?(Easy)
  2. What is the difference between a Docker image and a container?(Easy)
  3. Explain the difference between CMD and ENTRYPOINT in a Dockerfile.(Medium)
  4. What is a multi-stage build and why is it important?(Medium)
  5. What are Docker volumes and when would you use bind mounts instead?(Medium)
  6. Explain Docker networking modes.(Medium)
  7. How do you reduce Docker image size?(Medium)
  8. How does Docker layer caching work?(Medium)
  9. What is Docker Compose and when would you use it?(Easy)
  10. How does Docker handle secrets?(Hard)
  11. What is a Docker health check?(Medium)
  12. What is the Docker daemon and how does it work?(Hard)
  13. What is container security hardening?(Hard)
  14. How do you handle logging in Docker containers?(Medium)
  15. What is the difference between docker stop and docker kill?(Medium)
  16. What is BuildKit and how does it improve Docker builds?(Hard)
  17. How do you debug a running Docker container?(Medium)
  18. What is Docker Swarm and how does it compare to Kubernetes?(Medium)
  19. What are Docker labels and how are they used?(Easy)
  20. How does Docker's overlay filesystem work?(Hard)
  21. What is the .dockerignore file and why is it important?(Easy)
  22. What are Docker ARG and ENV and how do they differ?(Medium)
  23. What is the difference between COPY and ADD in a Dockerfile?(Easy)
  24. How do you set resource limits on Docker containers?(Medium)
  25. What is a Docker registry and how do you set up a private one?(Medium)
  26. What is WORKDIR in a Dockerfile and why should you use it?(Easy)
  27. How does Docker handle container restart policies?(Easy)
  28. What is the principle of container immutability and how do you implement it?(Medium)
  29. How do you handle environment-specific configuration in Docker?(Medium)
  30. What is Docker Content Trust and image signing?(Hard)
  31. How does Docker networking work internally? (veth pairs and iptables)(Hard)
  32. What is a multi-platform Docker image and how do you build one?(Medium)
  33. How do you manage Docker logs at scale?(Hard)
  34. What is the difference between EXPOSE and port publishing in Docker?(Easy)
  35. How do you optimize Docker images for Java/Spring Boot applications?(Hard)
  36. What is Docker-in-Docker (DinD) and why is it problematic?(Hard)
  37. How do you troubleshoot a container that won't start?(Medium)
  38. What is the Open Container Initiative (OCI) specification?(Hard)
  39. How do you use Docker for local database development?(Easy)
  40. How do you use Docker exec and what are common use cases?(Easy)
  41. What is a Dockerfile SHELL instruction?(Medium)
  42. What is Rootless Docker and why does it matter for security?(Hard)
  43. How do you use Docker Compose for integration testing?(Medium)
  44. What is Docker image tagging strategy?(Medium)
  45. What is the difference between CMD in shell form vs exec form?(Medium)
  46. How do you build Docker images in CI/CD pipelines efficiently?(Hard)
  47. What is container escape and how do you prevent it?(Hard)
  48. How do you implement a Docker-based database migration workflow?(Hard)
  49. What is a Docker context?(Medium)
  50. What are cgroups and how does Docker use them?(Hard)
  51. How do you scan Docker images for vulnerabilities?(Medium)
  52. How do you implement service-to-service communication with Docker Compose?(Medium)
  53. What is the impact of running as PID 1 in a container?(Hard)
  54. What are Docker Compose profiles?(Easy)
  55. How do you monitor Docker containers?(Medium)
  56. How do you use Docker volumes for persistent data and backups?(Medium)
  57. What is seccomp and how does Docker use it for security?(Hard)
  58. What is a distroless image and when should you use it?(Medium)
  59. How do you cache dependencies effectively for different languages in Docker?(Medium)
  60. What is an image manifest and manifest list?(Hard)
  61. How do you debug network issues between Docker containers?(Hard)
  62. What is the Docker container lifecycle?(Easy)
  63. How do you handle TLS/SSL certificates in Docker containers?(Hard)
  64. What is COPY --chown and how do you set file permissions in Dockerfile?(Medium)
  65. How do you implement blue-green deployments with Docker?(Hard)
  66. What is Docker's garbage collection and how do you manage disk space?(Easy)
  67. What is the FROM scratch instruction in Docker?(Hard)
  68. How do you use Docker for performance profiling and memory analysis?(Hard)
  69. What is Docker Desktop and how does it differ from Docker Engine?(Easy)
  70. What are Linux namespaces and which ones does Docker use?(Hard)
  71. How do you implement health-dependent startup ordering in Docker Compose?(Medium)
  72. What is a containerd shim and why does it exist?(Hard)
  73. How do you share data between containers in Docker?(Medium)
  74. What is Podman and how does it compare to Docker?(Medium)
  75. How do you handle configuration management across multiple Docker environments?(Medium)
  76. What is the difference between docker commit and building from Dockerfile?(Easy)
  77. How do you configure the Docker daemon (dockerd)?(Medium)
  78. What is the Docker build context and how does it affect build performance?(Medium)
  79. How do you implement canary deployments with Docker and Nginx?(Hard)
  80. What are Docker capabilities and how do you manage them?(Hard)
  81. How do you use Docker with GitHub Actions for CI/CD?(Medium)
  82. What is the Docker Compose watch feature and how does it improve developer experience?(Easy)
  83. How does Docker handle DNS resolution for containers?(Hard)
  84. What is image layer sharing and how does it save storage?(Medium)
  85. How do you implement autoscaling with Docker and a load balancer?(Hard)
  86. What is Docker Scout and how does it improve supply chain security?(Medium)
  87. How do you run stateful applications in Docker?(Medium)
  88. What is AppArmor and how does Docker use it?(Hard)
  89. How do you handle log rotation and disk usage for Docker container logs?(Medium)
  90. What are Docker's best practices for production deployments?(Medium)
  91. What is Kaniko and when should you use it over Docker-in-Docker?(Hard)
  92. How do you optimize Docker for Node.js applications?(Medium)
  93. What is Docker's host network mode and when should you use it?(Medium)
  94. What is an SBOM and how do you generate one for Docker images?(Medium)
  95. How do you handle Docker in air-gapped or offline environments?(Hard)
  96. What is a multi-container application pattern vs microservices in Docker?(Medium)
  97. How do you debug a crashed container and analyze the crash dump?(Hard)
  98. How do you implement service health checks and readiness probes in production?(Medium)
  99. What is BuildKit's advanced cache mount and secret mount feature?(Hard)
  100. What are the limits of Docker and when should you move to Kubernetes?(Medium)