Get a one-page Docker cheat sheet for common CLI commands
Follow a worked Flask Dockerfile example end to end
Apply image-size tips like slim bases.dockerignore, and multi-stage builds
Learn the difference between images, containers, volumes, and networks
Docs-only repo, so the only setup is having Docker installed and a small Python app handy for the worked example.
Docker in One Shot is a single-page learning resource for Docker that lives entirely inside this repository's README. It is written as a long cheat sheet that walks through what Docker is, the parts that make it up, the most common command-line commands, a small Flask example, and a short list of tips for making images smaller and safer. The audience is a beginner who already knows Python and wants a compact reference rather than a full course. The first section explains the basic idea of containers and lists nine core components: the Docker engine, the command-line client, images, containers, Dockerfiles, Docker Hub, volumes, networks, and Docker Compose. Each one gets a short definition and, where useful, a one-line example. The author uses an analogy from object-oriented programming for two of these concepts, calling an image a class and a container an object of that class. The middle of the README is a list of about twenty-two Docker commands. Each one shows the command, what it does, and a brief note when there are flags worth explaining. The list covers basic lifecycle commands like docker pull, build, run, stop, start, restart, and rm, plus log viewing, exec into a container, copying files between host and container, inspecting containers, viewing resource use, and creating volumes and networks. Two final commands cover docker compose up and down for multi-container setups. The end of the README provides a worked Flask example with app.py, requirements.txt, and a Dockerfile, then a list of image optimization tips: use slim base images, consider Alpine but watch out for compile issues, write a .dockerignore, order COPY and RUN steps so pip install caches well, combine apt commands, use multi-stage builds for larger projects, avoid running as root, pin specific image tags rather than using latest, and only install the packages you actually need. A short best practices section and a list of advanced topics for further study close the file.
Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.