Skip to content

Instantly share code, notes, and snippets.

@chriskyfung
Created August 7, 2023 06:41
Show Gist options
  • Save chriskyfung/9baf720573ad84c1a1948c66bccc4ca2 to your computer and use it in GitHub Desktop.
Save chriskyfung/9baf720573ad84c1a1948c66bccc4ca2 to your computer and use it in GitHub Desktop.
Dockerfile to build an image from bitnami/git with GitHub CLI and BFG Repo-Cleaner installed
FROM bitnami/git:latest
LABEL maintainer="@chriskyfung"
RUN apt update && apt install -y \
curl \
gpg
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
| gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg;
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
| tee /etc/apt/sources.list.d/github-cli.list > /dev/null
RUN curl -LJO https://repo1.maven.org/maven2/com/madgag/bfg/1.14.0/bfg-1.14.0.jar \
&& chmod +x bfg-1.14.0.jar \
&& mkdir /usr/local/bin/bfg/ \
&& mv bfg-1.14.0.jar /usr/local/bin/bfg/ \
&& echo 'alias bfg="java -jar /usr/local/bin/bfg/bfg-1.14.0.jar"' >> ~/.bashrc
RUN apt update && apt install -y \
gh \
default-jre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment