Skip to content

Commit

Permalink
fork gh cli to reduce the auth requested scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
altergui authored and p4u committed Nov 22, 2023
1 parent cb565a2 commit c8d5a17
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
### we forked gh to reduce the auth permissions requested
FROM golang:1.21 AS gh

WORKDIR /src

RUN wget https://github.com/vocdoni/gh-cli/archive/refs/tags/v2.39.3-vocdoni.tar.gz -O - | tar -xz --strip-components=1

RUN --mount=type=cache,sharing=locked,id=gomod,target=/go/pkg/mod/cache \
go mod download -x
RUN --mount=type=cache,sharing=locked,id=gomod,target=/go/pkg/mod/cache \
--mount=type=cache,sharing=locked,id=goroot,target=/root/.cache/go-build \
go build -ldflags="-s -w -X github.com/cli/cli/v2/internal/build.Version=v2.39.3-vocdoni -X github.com/cli/cli/v2/internal/build.Date=$(date --iso-8601)" \
-o=/bin ./cmd/gh

### image to contribute, verify, finish ceremonies
FROM node AS zk-voceremony

Expand All @@ -11,18 +25,15 @@ RUN apt update \
&& curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash \
&& apt install --no-install-recommends -y git-lfs \
&& git lfs install \
&& curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& 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 \
&& apt update \
&& apt install --no-install-recommends -y gh \
&& apt install --no-install-recommends -y jq \
&& apt autoremove -y \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*

COPY ./scripts/* /bin/

COPY --from=gh /bin/gh /bin/gh

CMD [ "contribute" ]

### image to create ceremonies
Expand Down

0 comments on commit c8d5a17

Please sign in to comment.