DevOps Notes – Docker & Containers
Prepared by Sathish Kumar
Introduction
Docker is a containerization platform that packages applications and dependencies into
lightweight, portable containers.
Architecture Overview
Docker uses a client-server model: Docker CLI interacts with the Docker daemon to build
and run containers based on images.
Key Commands
docker build, docker run, docker ps, docker images, docker exec, docker logs,
docker-compose.
Best Practices
1. Use small base images. 2. Don’t store secrets in images. 3. Tag images properly. 4.
Use multi-stage builds for optimization.
Interview Q&A;
Q: Difference between container and VM? A: Containers share the host OS kernel; VMs
have separate OS instances. Q: How do you persist data in Docker? A: Use Docker
volumes or bind mounts. Q: What is Docker Compose? A: It’s a tool to define and manage
multi-container applications using YAML files.
Summary
Docker simplifies deployment and scaling, enabling microservices and portability across
environments.