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”
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
Thank you so much for posting this! Bookmarked.
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.
I think you might like this: https://github.com/jesseduffield/lazydocker
I’m a big fan of the git one as well, lazygit
Nice! I have been using this site for awhile https://lzone.de/cheat-sheet/Docker
Has lots of other services and cheats besides docker. Always use it for redis commands I can never remember.
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?
Even though u/maxplanck_ is downvoted, he’s right – commands like `docker pull` should be replaced with `docker image pull`.