1️⃣ What is Docker?
A: Docker is an open-source platform that uses containerization to package, distribute, and run applications in isolated environments called containers.
2️⃣ What is a Container?
A: A lightweight, standalone executable package including code, runtime, libraries, and settings—runs consistently across any system.
3️⃣ Docker vs Virtual Machines (VMs)
- Docker: Shares host OS kernel, fast & efficient (MBs)
- VMs: Full OS per instance, heavier (GBs), slower startup
4️⃣ What is a Docker Image?
A: A read-only template (like a snapshot) used to create containers; built from a Dockerfile with layers of instructions.
5️⃣ Common Docker Commands:
-
docker run → Start a container from an image -
docker build → Create an image from Dockerfile -
docker ps → List running containers -
docker images → List available images -
docker stop → Stop a running container -
docker pull → Download an image from registry -
docker push → Upload image to registry 6️⃣ What is a Dockerfile?
A: A text file with instructions to automate building Docker images (e.g., FROM, RUN, COPY, CMD).
7️⃣ What is Docker Compose?
A: A tool for defining and running multi-container apps using YAML files—manages services, networks, volumes.
*8️⃣ What is Docker Hub?*
*A:* A public registry for storing and sharing Docker images, like GitHub for code.
9️⃣ What is Docker Swarm?
A: Docker's native clustering/orchestration tool for managing a swarm of Docker nodes and deploying services.
🔟 What are Docker Volumes?
A: Persistent storage for containers; data survives container lifecycle—mount host directories or use named volumes.
1️⃣1️⃣ What is Docker Networking?
A: Connects containers and services; modes include bridge (default), host, overlay (for Swarm), none.
1️⃣2️⃣ How to Build a Docker Image?
A: Write a Dockerfile, run
docker build -t image-name. in the directory—tags it for easy reference.1️⃣3️⃣ Difference between CMD and ENTRYPOINT?
- CMD: Default args for executable; can be overridden
- ENTRYPOINT: Sets container's executable; args append to it
1️⃣4️⃣ What is Container Orchestration?
A: Managing multiple containers at scale; tools like Kubernetes, Docker Swarm handle deployment, scaling, load balancing.
1️⃣5️⃣ How to Handle Docker Security?
A: Run as non-root, scan images (e.g., Trivy), use minimal base images, limit privileges, and keep software updated.
💬 Tap ❤️ if you found this useful!