Skip to content

piraces/docker-bfg-repo-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-bfg-repo-cleaner

Publish Docker image CI Dive Check Docker GitHub Docker Pulls

A docker image for BFG Repo-Cleaner (by rtyley).

How is built

  • Actually is built using the openjdk official image only with JRE (openjdk:8-jre-slim).
  • The actual .jar file is in this repo, managed with Git LFS. You can check the checksum from the original published .jar available here.
  • In order to be able to execute the command bfg as it is, a little trick is made by specifying a 'Shebang' and the .jar file content in an executable in the /bin folder of the container.

How to use it

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.

CI/CD workflows

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.