Skip to content

Instantly share code, notes, and snippets.

@caffeinetiger
Last active April 18, 2022 18:17
Show Gist options
  • Select an option

  • Save caffeinetiger/9341a526dce9283ef8597e7b96a81305 to your computer and use it in GitHub Desktop.

Select an option

Save caffeinetiger/9341a526dce9283ef8597e7b96a81305 to your computer and use it in GitHub Desktop.
[Official documentation for docker image prune](https://docs.docker.com/engine/reference/commandline/image_prune/)
#!/bin/bash
# Prune all unused images
docker image prune --all
# The filtering flag (--filter) format is of “key=value”. If there is more than one filter, then pass multiple flags
docker image prune --filter "foo=bar"
# For more details on the filter flag option see official documentation mentioned in the description
# Prune all unused images with no confirmation
docker image prune --all --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment