diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ea9e843 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM ruby:4.0-alpine + +RUN apk add --no-cache \ + build-base \ + git \ + libgit2-dev \ + cmake + +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"] 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