How to use the Docker Commands Cheat Sheet
- 1. Search a taskType logs, volume or prune to jump to the right command.
- 2. Copy the syntaxEach card shows a ready example you can adapt.
- 3. DownloadSave the filtered list as a text file for your notes.
Commands grouped by job
The sheet is split into images, containers, debugging, volumes, networks, Compose, cleanup, registry and tips. A typical day touches each group: docker build -t myapp:1.0 . to build, docker run -d --name web -p 8080:80 nginx to start a container in the background with host port 8080 mapped to container port 80, docker logs -f --tail 100 web to watch it, and docker exec -it web sh to look inside.
The Compose section uses the current docker compose plugin syntax with a space. The older docker-compose with a hyphen still works on some machines but is no longer developed.
Cleaning up without losing data
docker system dfshows how much space images, containers and volumes take.docker system pruneremoves stopped containers, unused networks and dangling images. Add-ato remove all unused images too.docker compose down -valso deletes the stack's named volumes, which means database data. Leave out -v unless you mean it.docker volume rmdeletes a volume's data permanently.
Pass secrets with -e or --env-file at run time rather than baking them into an image, and log in to registries with access tokens instead of your password. Turn a long docker run line into a file with the docker run to Compose converter, or write a new one with the Dockerfile generator.
Frequently asked questions
What is the difference between docker stop and docker kill?
stop sends SIGTERM and waits (10 seconds by default) before SIGKILL, so the app can shut down cleanly. kill sends SIGKILL straight away.
Do these commands work with Podman?
Most do, because Podman copies the Docker command line. Compose and some network options differ.
Is the Docker Commands Cheat Sheet free?
Yes, the Docker Commands Cheat Sheet is free. The first time you download your first cheat sheet, you are asked for your name and WhatsApp number once. After that, this and every other Uncodemy tool opens straight away without the form.