A docker image for BFG Repo-Cleaner (by rtyley).
- Actually is built using the openjdk official image only with JRE (openjdk:8-jre-slim).
- The actual
.jarfile is in this repo, managed withGit LFS. You can check the checksum from the original published.jaravailable here. - In order to be able to execute the command
bfgas it is, a little trick is made by specifying a 'Shebang' and the.jarfile content in an executable in the/binfolder of the container.
It only requires you to mount the repository you want to use with bfg and perform the command you want.
For example to remove .env files in my repository using bfg:
docker run --rm -v /c/DEV:/usr/src/myrepo -w /usr/src/myrepo piraces/bfg-repo-cleaner:latest bfg --delete-files .env /usr/src/myrepo/exercise-remove-commit-history.git # Using Docker Hub image
docker run --rm -v /c/DEV:/usr/src/myrepo -w /usr/src/myrepo ghcr.io/piraces/bfg-repo-cleaner:latest bfg --delete-files .env /usr/src/myrepo/exercise-remove-commit-history.git # Using GitHub Docker image (no pull limits)Make sure to specify the correct path to mount and the working directory.
There are two workflows defined in this repository:
- Publish Docker Image: builds, tag, label and push the image on every release to GitHub Docker repository and Docker Hub.
- CI Dive Check: checks with dive every commit and PR to ensure we are keeping wasted space to a minimum.