Skip to content

Commit

Permalink
Install gh from github releases
Browse files Browse the repository at this point in the history
Fixes issue with package signing. See: cli/cli#6175
  • Loading branch information
brew committed Sep 5, 2022
1 parent 98af462 commit 22553e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# Dockerfile used as GitHub action
FROM python:latest AS base

RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/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-get update --allow-releaseinfo-change && \
RUN apt-get update --allow-releaseinfo-change && \
DEBIAN_FRONTEND="noninteractive" apt-get -yq install \
bash \
curl \
jq \
gh && \
&& t="/tmp/gh-$$.deb" && curl -sSLo "$t" "https://github.com$(curl -sSL "https://github.com/cli/cli/releases/latest" | grep -Po "(?<=href=\")/cli/cli/releases/download/[^\"]*$(dpkg --print-architecture)[.]deb(?=\")")" && apt-get install -y "$t" && rm "$t" \
rm -rf /var/lib/apt/lists/* $HOME/.python_history $HOME/.wget-hsts

ENV PYTHONPATH="/"
Expand Down
6 changes: 2 additions & 4 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# Dockerfile used for development and testing
FROM python:latest AS base

RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/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-get update --allow-releaseinfo-change && \
RUN apt-get update --allow-releaseinfo-change && \
DEBIAN_FRONTEND="noninteractive" apt-get -yq install \
bash \
curl \
jq \
gh && \
&& t="/tmp/gh-$$.deb" && curl -sSLo "$t" "https://github.com$(curl -sSL "https://github.com/cli/cli/releases/latest" | grep -Po "(?<=href=\")/cli/cli/releases/download/[^\"]*$(dpkg --print-architecture)[.]deb(?=\")")" && apt-get install -y "$t" && rm "$t" \
rm -rf /var/lib/apt/lists/* $HOME/.python_history $HOME/.wget-hsts

ENV PYTHONPATH="/"
Expand Down

0 comments on commit 22553e7

Please sign in to comment.