🧱 Docker Basics
1. What is the difference between Docker image and Docker container?
2. How do you create and run a container with a specific name?
3. Explain the purpose of docker run -it --rm command.
4. How can you view all stopped containers? How do you remove them?
5. What is the difference between CMD and ENTRYPOINT in Dockerfile?
🛠 Image & Container Management
6. How do you create an image from a Dockerfile?
7. What does docker tag do and how is it used?
8. Explain docker save and docker load with an example.
9. What is the use of docker rmi and how do you avoid errors while removing?
10. How can you reduce image size? Give at least 3 best practices.
🌐 Networking & Volumes
11. What are the default Docker networks and their use cases?
12. What is the difference between bridge, host, and overlay networks?
13. How do you create and attach a named volume to a container?
14. What is a bind mount vs named volume? When to use each?
15. How do you inspect the network details of a container?
🔐 Security
16. How do you run a container in read-only mode?
17. What is --cap-drop ALL and when would you use it?
18. How can you run containers without root privileges?
19. What tools can you use to scan Docker images for vulnerabilities?
20. What are Docker secrets and how do they differ from environment variables?
📈 Health Check & Debugging
21. How do you define a health check in a Dockerfile or Compose file?
22. How do you view the health status of a container?
23. What’s the difference between docker logs, exec, and attach?
24. How do you debug a container that's not starting?
25. What are some reasons a health check might fail?
📦 Docker Compose
26. Write a Docker Compose file for a web app and a database.
27. How do you pass environment variables securely in Compose?
28. What is the difference between depends_on and health checks in Compose?
29. How do you override a Compose service in another file?
30. How do you scale a service using Docker Compose?
🐳 Docker Swarm
31. What is the architecture of Docker Swarm?
32. How do you initialize a Swarm and add worker nodes?
33. How do you deploy a service and a stack in Swarm?
34. How do you drain a manager node? Why would you do that?
35. What are the differences between a service and a container in Swarm?
🔁 CI/CD & Registry
36. How do you push a Docker image to Docker Hub?
37. What are the steps to authenticate and push to JFrog Artifactory?
38. How do you integrate Docker build & push in a CI/CD pipeline?
39. What is a multi-stage build and when should you use it?
40. How do you use .dockerignore to optimize Docker builds?
🎯 Bonus Advanced Real-World Tasks
41. Build a multi-container app with NGINX, Flask, and Redis using Compose.
42. Create a lightweight Alpine-based image that runs a Python script.
43. Configure automatic restart policies for your container.
44. Simulate and recover from a container crash.
45. Monitor a running container with cadvisor and docker stats.