From 5b67d47fa76a23e2181adabb8b2333943d1d4663 Mon Sep 17 00:00:00 2001 From: Aman Sharma Date: Fri, 9 Jan 2026 02:59:09 +0530 Subject: [PATCH 1/4] Dockerize CLI --- Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f92f876 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM ruby:3.4-alpine + +RUN apk add --no-cache \ + build-base \ + git \ + libgit2-dev \ + cmake + +RUN gem install git-pkgs + +ENTRYPOINT ["git", "pkgs"] From e02b266c8fb25ef76a7efa37fec8041b4f73aa2e Mon Sep 17 00:00:00 2001 From: Aman Sharma Date: Fri, 9 Jan 2026 03:14:54 +0530 Subject: [PATCH 2/4] Update Ruby to 4.0 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f92f876..d119ea4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.4-alpine +FROM ruby:4.0-alpine RUN apk add --no-cache \ build-base \ From efb216452aa162003f40126d7a70d4a865d08dc2 Mon Sep 17 00:00:00 2001 From: Aman Sharma Date: Fri, 9 Jan 2026 19:38:58 +0530 Subject: [PATCH 3/4] Bypass git restriction for performing git operations as different user --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index d119ea4..ea9e843 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,11 @@ RUN apk add --no-cache \ RUN gem install git-pkgs +# The git repository (the mounted directory) has different ownership that the root user of the container. +# Due to an update in git, a different user cannot perform git operations on the mounted directory. +# This command allows the any user to perform git operations on the mounted directory. +RUN git config --system --add safe.directory /mnt + +WORKDIR /mnt + ENTRYPOINT ["git", "pkgs"] From 2bd54d2aad4b2ee20686695500d6a6ad7ceb9e76 Mon Sep 17 00:00:00 2001 From: Aman Sharma Date: Fri, 9 Jan 2026 19:41:16 +0530 Subject: [PATCH 4/4] Document usage using Docker container --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 6462855..309806a 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,13 @@ Or with RubyGems: gem install git-pkgs ``` +Or using Docker: + +```bash +docker build -t git-pkgs . +docker run -it --rm -v $(pwd):/mnt git-pkgs +``` + ## Quick start ```bash