# Docker cheat sheets: run, compose and cleanup

> Verified Docker references: the core run/build/exec commands, Docker Compose for multi-container apps, and the cleanup commands that reclaim disk — checked against the official docs.

- Page URL: https://itinsighthub.com/docker/
- Markdown variant of this page: append `?format=md` to any URL on this site or send `Accept: text/markdown`.
- Full site index for AI assistants: https://itinsighthub.com/llms.txt
- Full site export: https://itinsighthub.com/llms-full.txt

# Docker cheat sheets

Docker packages an application and its dependencies into a lightweight container that runs identically anywhere. Three concepts sit under every command: an **image** (the immutable template), a **container** (a running instance of an image) and a **volume** (persistent storage that survives the container). [Core commands](https://itinsighthub.com/docker/basics/) covers the loop — run, ps, exec, logs, build — and the `docker run` flags you actually need. [Docker Compose](https://itinsighthub.com/docker/compose/) covers the `compose.yaml` file and the `docker compose` commands for multi-container apps. [Cleanup & disk](https://itinsighthub.com/docker/cleanup/) covers pruning images, containers, volumes and build cache — the part most people learn the hard way.

Every command is verified against the official Docker documentation and behaves identically on Docker Desktop (Windows/macOS) and Docker Engine (Linux). Two facts worth knowing up front: `docker compose` (no hyphen) is the current V2 plugin command — the old `docker-compose` V1 binary is deprecated — and stopped containers and dangling images quietly pile up until you prune them.

## Cheat sheets

### Core commands

run, ps, exec, logs, build and the docker run flags — the container lifecycle you type daily.

### Docker Compose

The compose.yaml file and the docker compose commands for multi-container apps and services.

### Cleanup & disk

Reclaim disk: system df, prune (system/image/container/volume), and removing dangling images.

## Network tools

[Subnet Calculator](https://itinsighthub.com/subnet-calculator/)[IPv6 Calculator](https://itinsighthub.com/ipv6-subnet-calculator/)[Wildcard Mask](https://itinsighthub.com/wildcard-mask-calculator/)[Range → CIDR](https://itinsighthub.com/ip-range-to-cidr/)[Splitter](https://itinsighthub.com/subnet-splitter/)[Aggregator](https://itinsighthub.com/cidr-aggregator/)[VLSM Calculator](https://itinsighthub.com/vlsm-calculator/)[Practice](https://itinsighthub.com/subnetting-practice/)[Cheat Sheet](https://itinsighthub.com/subnet-cheat-sheet/)

## FAQ

**What is Docker?**

Docker is a platform for packaging applications into containers — lightweight, isolated environments that bundle an app with its dependencies and run identically on any host. Unlike a virtual machine, a container shares the host's kernel, so it starts in seconds and uses a fraction of the resources. Docker's three core objects are images (immutable templates), containers (running instances) and volumes (persistent data).

**What is the difference between Docker and a virtual machine?**

A virtual machine runs a full guest operating system on a hypervisor, each with its own kernel, so it is heavy and slow to boot. A container shares the host kernel and only isolates the application's userspace, so it starts in milliseconds and costs far less memory and disk. Containers give you process-level isolation, not hardware-level isolation.

**What is Docker Compose for?**

Compose lets you define a multi-container application (a web server plus a database plus a cache, for example) in one declarative compose.yaml file and manage the whole stack with docker compose up / down / logs. Without Compose you would string together many docker run commands by hand.

**Where do I find images to run?**

Docker Hub (hub.docker.com) is the default public registry, hosting official images for nginx, postgres, redis, node, python and thousands of others. docker pull downloads one, and docker run pulls automatically if the image is not local. Tag syntax is :, e.g. postgres:16 — the tag :latest is implied when omitted.

---

© 2026 ITInsightHub · [About](https://itinsighthub.com/about/) · [Contact](https://itinsighthub.com/contact/) · [Privacy](https://itinsighthub.com/privacy/)
