From 40098ffb862c2eb5ce2b7c2ad05022d2658244dc Mon Sep 17 00:00:00 2001 From: Matt Farina Date: Wed, 3 Dec 2025 14:12:05 -0500 Subject: [PATCH] Updating the devcontainer to include copilot Signed-off-by: Matt Farina --- .devcontainer/Dockerfile | 53 ++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1e559fe..034cc6e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,39 +1,38 @@ -# Use SUSE BCI Golang as the base image -FROM registry.suse.com/bci/golang:1.25 +# Use the official Go + Node.js devcontainer base image +FROM mcr.microsoft.com/devcontainers/go:1.25 + +# Install Node.js +RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ + apt-get install -y nodejs && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* # Install VCS tools and other dependencies -RUN zypper --non-interactive refresh && \ - zypper --non-interactive install -y \ +RUN apt-get update && \ + apt-get install -y \ git \ mercurial \ subversion \ bzr \ make \ curl \ - sudo \ - shadow && \ - zypper clean --all - -# Create a non-root user for development -ARG USERNAME=vscode -ARG USER_UID=1000 -ARG USER_GID=$USER_UID - -RUN groupadd --gid $USER_GID $USERNAME && \ - useradd --uid $USER_UID --gid $USER_GID -m $USERNAME && \ - echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && \ - chmod 0440 /etc/sudoers.d/$USERNAME - -# Set up Go workspace -ENV GOPATH=/go -ENV PATH=$GOPATH/bin:/usr/local/go/bin:$PATH - -# Create Go workspace directories with correct permissions -RUN mkdir -p /go/src /go/bin /go/pkg && \ - chown -R $USERNAME:$USERNAME /go + sudo && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* -# Switch to the non-root user -USER $USERNAME +# Install GitHub Copilot CLI (architecture-aware) +RUN ARCH=$(uname -m) && \ + if [ "$ARCH" = "x86_64" ]; then \ + COPILOT_ARCH="amd64"; \ + elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then \ + COPILOT_ARCH="arm64"; \ + else \ + echo "Unsupported architecture: $ARCH" && exit 1; \ + fi && \ + curl -fsSL -o /tmp/copilot.tar.gz "https://github.com/github/copilot-cli/releases/download/v0.0.366-9/copilot-linux-${COPILOT_ARCH}.tar.gz" && \ + tar -xzf /tmp/copilot.tar.gz -C /usr/local/bin && \ + chmod +x /usr/local/bin/copilot && \ + rm -f /tmp/copilot.tar.gz # Set working directory WORKDIR /workspace