What is Docker?ΒΆ
OverviewΒΆ
Docker is a platform for building, packaging, and running applications in containers.
A container bundles:
- Application code
- Runtime
- Dependencies
- System libraries
This allows the application to run consistently across environments.
Why Docker ExistsΒΆ
Before containers, applications often failed due to environment differences:
"It works on my machine"
Docker solves this by:
- Standardising environments
- Isolating applications
- Making deployments reproducible
What is a Container?ΒΆ
A container is:
- A lightweight, isolated process
- Running on a shared host OS kernel
- Packaged with everything it needs to run
Unlike virtual machines, containers do not include a full operating system.
Docker ArchitectureΒΆ
graph TD
Developer --> DockerCLI
DockerCLI --> DockerDaemon
DockerDaemon --> Images
DockerDaemon --> Containers
DockerDaemon --> Registry
Registry -->|Pull/Push| DockerDaemon
Key ComponentsΒΆ
Docker CLIΒΆ
Command-line interface used by developers.
Docker DaemonΒΆ
Background service that builds and runs containers.
Docker ImagesΒΆ
Immutable templates used to create containers.
Docker ContainersΒΆ
Running instances of images.
Docker RegistryΒΆ
Stores and distributes images (e.g., Docker Hub).
How Docker WorksΒΆ
- Developer writes a Dockerfile
- Docker builds an image
- Image is stored locally or in a registry
- Container is started from the image
Real-World ImplicationsΒΆ
- Containers start in seconds (vs minutes for VMs)
- Applications become portable across environments
- Infrastructure becomes easier to automate
Key TakeawaysΒΆ
- Docker packages applications with dependencies
- Containers are lightweight and fast
- Images are immutable; containers are runtime instances