Docker Commands Cheat Sheet
Here’s a curated list of the most important Docker commands, grouped by what you actually do — not alphabetically. 1. Build & Tag Images docker build -t name:tag . Builds an image from a Dockerfile in the current directory. docker build -t my_app:latest . Most common flags: -f — specify a different Dockerfile path . — the build context (current directory); omit -f when the Dockerfile is in the same directory --no-cache — force a full rebuild, skipping the layer cache -t / --tag — give the image a name and optional version tag; defaults to latest if omitted Pro tip: Add a .dockerignore file to exclude unnecessary files (__pycache__, .git, data dumps) from the build context — it can dramatically speed up builds. ...