Skip to content

Commit 40098ff

Browse files
committed
Updating the devcontainer to include copilot
Signed-off-by: Matt Farina <matt.farina@suse.com>
1 parent 645e870 commit 40098ff

1 file changed

Lines changed: 26 additions & 27 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
1-
# Use SUSE BCI Golang as the base image
2-
FROM registry.suse.com/bci/golang:1.25
1+
# Use the official Go + Node.js devcontainer base image
2+
FROM mcr.microsoft.com/devcontainers/go:1.25
3+
4+
# Install Node.js
5+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
6+
apt-get install -y nodejs && \
7+
apt-get clean && \
8+
rm -rf /var/lib/apt/lists/*
39

410
# Install VCS tools and other dependencies
5-
RUN zypper --non-interactive refresh && \
6-
zypper --non-interactive install -y \
11+
RUN apt-get update && \
12+
apt-get install -y \
713
git \
814
mercurial \
915
subversion \
1016
bzr \
1117
make \
1218
curl \
13-
sudo \
14-
shadow && \
15-
zypper clean --all
16-
17-
# Create a non-root user for development
18-
ARG USERNAME=vscode
19-
ARG USER_UID=1000
20-
ARG USER_GID=$USER_UID
21-
22-
RUN groupadd --gid $USER_GID $USERNAME && \
23-
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME && \
24-
echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && \
25-
chmod 0440 /etc/sudoers.d/$USERNAME
26-
27-
# Set up Go workspace
28-
ENV GOPATH=/go
29-
ENV PATH=$GOPATH/bin:/usr/local/go/bin:$PATH
30-
31-
# Create Go workspace directories with correct permissions
32-
RUN mkdir -p /go/src /go/bin /go/pkg && \
33-
chown -R $USERNAME:$USERNAME /go
19+
sudo && \
20+
apt-get clean && \
21+
rm -rf /var/lib/apt/lists/*
3422

35-
# Switch to the non-root user
36-
USER $USERNAME
23+
# Install GitHub Copilot CLI (architecture-aware)
24+
RUN ARCH=$(uname -m) && \
25+
if [ "$ARCH" = "x86_64" ]; then \
26+
COPILOT_ARCH="amd64"; \
27+
elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then \
28+
COPILOT_ARCH="arm64"; \
29+
else \
30+
echo "Unsupported architecture: $ARCH" && exit 1; \
31+
fi && \
32+
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" && \
33+
tar -xzf /tmp/copilot.tar.gz -C /usr/local/bin && \
34+
chmod +x /usr/local/bin/copilot && \
35+
rm -f /tmp/copilot.tar.gz
3736

3837
# Set working directory
3938
WORKDIR /workspace

0 commit comments

Comments
 (0)