From 826fb205d24988712914f98bf5506dafa50eaca9 Mon Sep 17 00:00:00 2001 From: xiaomakuaiz Date: Tue, 7 Apr 2026 04:13:53 +0000 Subject: [PATCH] chore(base): install gh from GitHub releases instead of apt repo Remove cli.github.com apt source and install gh CLI v2.89.0 directly from GitHub releases binary tarball. This avoids adding an extra apt repository and reduces dependencies. Co-authored-by: monkeycode-ai --- docker/base/bookworm/Dockerfile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docker/base/bookworm/Dockerfile b/docker/base/bookworm/Dockerfile index 42df190..b63eca5 100644 --- a/docker/base/bookworm/Dockerfile +++ b/docker/base/bookworm/Dockerfile @@ -42,12 +42,18 @@ RUN apt-get update \ python3-pip \ ripgrep \ zsh \ - && curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \ - -o /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" \ - > /etc/apt/sources.list.d/github-cli.list \ - && apt-get update \ - && apt-get install -y --no-install-recommends gh \ + && GH_VERSION="2.89.0"; \ + arch=$(dpkg --print-architecture); \ + case "${arch}" in \ + amd64) gh_arch="amd64" ;; \ + arm64) gh_arch="arm64" ;; \ + *) echo "Unsupported architecture: ${arch}" && exit 1 ;; \ + esac; \ + curl -fsSL "https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_${gh_arch}.tar.gz" \ + -o /tmp/gh.tar.gz; \ + tar -xzf /tmp/gh.tar.gz -C /tmp; \ + mv /tmp/gh_${GH_VERSION}_linux_${gh_arch}/bin/gh /usr/local/bin/gh; \ + rm -rf /tmp/gh.tar.gz /tmp/gh_${GH_VERSION}_linux_${gh_arch} \ && ln -sf /usr/bin/vim.tiny /usr/bin/vim \ && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \ && locale-gen \