Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 26 additions & 27 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Loading