Ref: https://learn.cantrill.io/courses/docker-fundamentals/lectures/44151958 =OR= https://www.youtube.com/watch?v=52SmfrVctB0
DEMO: https://learn.cantrill.io/courses/docker-fundamentals/lectures/44706186 =OR= https://www.youtube.com/watch?v=DkIUPdRF7Fg
Docker Architecture - Components
- 🔧 Docker Architecture follows a client-server paradigm (Docker Client-Docker Host)
- Docker Host - includes:
- Docker Daemon = dockerd
- engine/brains of Docker Host
- long-running service
- exposes Docker API for clients to interact with it
- Images
- immutable, read-only templates
- can be used to launch/run containers
- Containers
- running process inside Docker OS
- running instance of an image = an image with an added writable layer
- Docker Client
- E.g. Docker Desktop, CLI, other apps that interact with dockerd…
- Uses Docker API to send commands to dockerd
- Registry (HUB)
- E.g. Docker Hub
- Public/private remote storage for images
Basic Commands
- Registry/HUB interaction
docker pull <imgID>
- dockerd pulls (downloads) image, stores it locally in Host
docker push <imgID>
- dockerd pushes an image to registry/HUB
- Container running status interaction
docker run <imgID>
- dockerd runs an image (creates new container or starts old one)
- pulls image from registry if needed, i.e. if image not pulled into Docker Host yet
docker stop <contID>
- dockerd stops a running container
docker start <contID>
- dockerd starts a stopped container
docker restart <contID>
- dockerd restarts a container (stops and starts it again)
- Overview
docker ps
- show all running containers.
docker ps -a
- show all containers (whether running or stopped).
- 💡 ps = “process status”. -a = “all”
docker images
- show all images
- Image creation
docker build <file>
- dockerd uses a Dockerfile to create a new image
- đź’ˇMost of these commands map directly to API endpoints
- e.g.Â
docker ps
 = GET /containers/json
Docker Architecture Diagram
