Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwpl/37952c96e276ef3346b85c9724576ce9 to your computer and use it in GitHub Desktop.
Save gwpl/37952c96e276ef3346b85c9724576ce9 to your computer and use it in GitHub Desktop.
docker cleanup - freeing disk space or building fresh regardless of cache
#!/bin/bash
set -x
docker image prune -a
docker system prune -a # from https://www.freecodecamp.org/news/where-are-docker-images-stored-docker-container-paths-explained/
#docker volumes prune # from https://www.freecodecamp.org/news/where-are-docker-images-stored-docker-container-paths-explained/
# altnernatively:
# How to force Docker for a clean build of an image without deleting cache
# and btw https://stackoverflow.com/a/60140109/544721 -> docker builder prune -af
#
# docker-compose build --no-cache &&
# docker-compose up -d --force-recreate
@gwpl
Copy link
Author

gwpl commented Jul 29, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment