Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/piraces/docker-bfg-repo-cleaner

A docker image for BFG Repo-Cleaner (by @rtyley)
https://github.com/piraces/docker-bfg-repo-cleaner

bfg blobs cleaning docker git git-filter-branch repository

Last synced: 12 days ago
JSON representation

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

Awesome Lists containing this project

README

        

# docker-bfg-repo-cleaner

[![Publish Docker image](https://github.com/piraces/docker-bfg-repo-cleaner/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/piraces/docker-bfg-repo-cleaner/actions/workflows/docker-publish.yml)
[![CI Dive Check](https://github.com/piraces/docker-bfg-repo-cleaner/actions/workflows/dive-check.yml/badge.svg)](https://github.com/piraces/docker-bfg-repo-cleaner/actions/workflows/dive-check.yml)
Docker GitHub
Docker Pulls

A docker image for [BFG Repo-Cleaner (by rtyley)](https://rtyley.github.io/bfg-repo-cleaner/).

# How is built

- Actually is built using the [openjdk](https://hub.docker.com/_/openjdk/) official image only with JRE ([openjdk:8-jre-slim](https://hub.docker.com/_/openjdk/?tab=tags&page=1&name=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](https://repo1.maven.org/maven2/com/madgag/bfg/1.14.0/bfg-1.14.0.jar).
- In order to be able to execute the command `bfg` as it is, a little trick is made by specifying a ['Shebang'](https://bash.cyberciti.biz/guide/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`:

```bash
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](https://github.com/piraces/docker-bfg-repo-cleaner/actions/workflows/docker-publish.yml): builds, tag, label and push the image on every release to GitHub Docker repository and Docker Hub.
- [CI Dive Check](https://github.com/piraces/docker-bfg-repo-cleaner/actions/workflows/dive-check.yml): checks with [dive](https://github.com/wagoodman/dive) every commit and PR to ensure we are keeping wasted space to a minimum.