Add the GitHub CLI to the Codespaces container (#72287)
authorKevin Jones <kevin@vcsjones.com>
Sat, 16 Jul 2022 01:27:22 +0000 (21:27 -0400)
committerGitHub <noreply@github.com>
Sat, 16 Jul 2022 01:27:22 +0000 (21:27 -0400)
* Add the GitHub CLI to the Codespaces container

* More closely follow existing public docs.

.devcontainer/Dockerfile

index 436beac..54f5f2f 100644 (file)
@@ -5,12 +5,18 @@
 ARG VARIANT="6.0-focal"
 FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}
 
-# Set up machine requirements to build the repo
+# Setup the gh (GitHub) CLI signing key.
+RUN 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
+
+# Set up machine requirements to build the repo and the gh CLI
 RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
     && apt-get -y install --no-install-recommends cmake llvm-10 clang-10 \
         build-essential python curl git lldb-6.0 liblldb-6.0-dev \
         libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev \
-        libssl-dev libnuma-dev libkrb5-dev zlib1g-dev ninja-build
+        libssl-dev libnuma-dev libkrb5-dev zlib1g-dev ninja-build \
+        gh
 
 # Install V8 Engine
 SHELL ["/bin/bash", "-c"]