Docker
Docker is a platform for building, running, and packaging applications inside containers — isolated, lightweight environments that bundle an application together with everything it needs to run (libraries, dependencies, configuration) without requiring a full separate operating system underneath, unlike a traditional virtual machine.
Containers vs virtual machines
A virtual machine virtualises an entire computer — its own kernel, its own operating system, its own virtual hardware — making it heavy but fully isolated. A container instead shares the host machine’s kernel and only packages the application layer above it, making containers dramatically lighter and faster to start, at the cost of slightly less isolation than a full VM. The practical distinction is: use a full virtual machine when you need a machine, use a container when you only need the tools or the application.
Core concepts
- Image — a saved, read-only template containing an application and everything it needs to run
- Container — a running instance of an image; can be started, stopped, and removed without affecting the underlying image
- Dockerfile — a text file describing how to build a custom image, step by step
- Volumes — persistent storage that survives beyond a container’s own lifecycle, since a container’s own filesystem is disposable by default
- Docker Compose — a way to define and run multiple related containers together as a single stack, via a single YAML file
Common commands
docker ps # list running containers
docker ps -a # list all containers, including stopped ones
docker images # list downloaded images
docker start <container> # start a stopped container
docker stop <container> # stop a running container
docker exec -it <container> bash # open a shell inside a running container
docker logs <container> # view a container's output/logsRelevance
Docker is a great way to gain extra function or tooling without using up large amounts of system resource. For my homelab it means I can run services like Open WebUI for Local AI, and providing a disposable Kali Linux CLI toolbox for Cybersecurity work without needing a full virtual machine for every task. It a strategy I will be happy to use again.