01 - Docker Fundamentals
Docker fundamentals
What is Docker?
Docker is an open-source container platform that packages apps and dependencies into portable containers that run anywhere Docker is supported. It uses Linux namespaces and cgroups for isolation.
Core components
1. Docker Engine
- Daemon: background service on the host.
- REST API: interface to the daemon.
- Docker CLI: command-line client.
2. Docker Image
Read-only template with instructions to create containers. It can include OS, app code, dependencies, env vars, and config files.
3. Docker Container
Running instance of an image. Can be created/started/stopped/moved/removed. Containers are isolated, ensuring consistent runtime.
4. Docker Registry
Stores and distributes images. Docker Hub is common; orgs often run private registries.
Why Docker?
- Consistent environments: same behavior across dev/test/prod—no “works on my machine”.
- Fast deployment: spin containers quickly, shorten delivery.
- Isolation: containers avoid conflicts with others/host.
- Resource efficiency: share host kernel; lighter than VMs, faster startup.
- Versioning: images are versioned; easy rollback.
- Modularity & scale: microservice-friendly; easier scaling and maintenance.
Typical use cases
- Standardized dev envs: everyone codes inside the same container.
- CI/CD: plug into pipelines for automated test/deploy.
- Microservices: each service in its own container, scaled independently.
- Rapid prototyping: try stacks without local setup hassles.
- Cross-platform deploy: run on any Docker host—local, staging, cloud.
Summary
Docker tackles environment drift and deployment pain with containers, delivering consistency, faster rollout, better resource use, and modern architecture support. Next: install Docker, manage containers, and build custom images.