Skip to content

Helpful Docker Commands

Shawn P. Serbin edited this page Oct 6, 2022 · 9 revisions

A few helpful commands for managing your Docker environment

You can cleanup (prune) your environment to remove any images that are unused by taking up space on your computer

To cleanup unused images:

docker image prune

You can also remove specific images. E.g. First do

docker image ls

Then identify the ID of the image to remove, e.g. 2bb301e6a312 Screen Shot 2022-10-06 at 1 30 12 PM

you can then delete by doing

docker image rm -f 2bb301e6a312

To cleanup old volumes:

docker volume prune

You can remove any containers you aren't using, however (warning!!) this would remove your ELM or Jupyter containers if not running:

docker container prune

You can cleanup everything at once using:

docker system prune

The docker system prune command is a shortcut that prunes images, containers, and networks. Volumes are not pruned by default, and you must specify the --volumes flag for docker system prune to prune volumes, e.g.

docker system prune --volumes

Return to Home