Docker CLI Cheat Sheet

I created a [Docker CLI Cheat Sheet](https://swissarmydevops.com/containers/docker/docker-cli-cheat-sheet) to prevent me from googling "How to do X in Docker" so frequently. Hopefully this helps you as well! If you download the PDF from that link you can search for text and double click to copy a line for easy pasting.

11 thoughts on “Docker CLI Cheat Sheet”

  1. You missed a few:

    docker run –rm [….] # use –rm to clean up the container after you or it exits.

    docker system prune -f –volumes # clean up untagged images, remove volumes not actively being used
    docker system prune -fa –volumes # the added -a removes ALL non-running images and unused volumes

    docker-compose down –volumes # supports –volumes, too
    docker-compose pull # pulls latest images, `up` will recreate automatically

    Reply
  2. This is awesome, thanks! I’ve been adding common docker commands to an internal wiki, but yours is much more fleshed out so I’ll just download yours.

    Reply
  3. The commands which you are using are older and soon they may be deprecated. There are newer set of commands for docker using management commands.
    can you upload that?

    Reply
  4. Even though u/maxplanck_ is downvoted, he’s right – commands like `docker pull` should be replaced with `docker image pull`.

    Reply

Leave a Comment