|
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/* |
3 | 9 |
|
4 | 10 | # 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 \ |
7 | 13 | git \ |
8 | 14 | mercurial \ |
9 | 15 | subversion \ |
10 | 16 | bzr \ |
11 | 17 | make \ |
12 | 18 | 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/* |
34 | 22 |
|
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 |
37 | 36 |
|
38 | 37 | # Set working directory |
39 | 38 | WORKDIR /workspace |
0 commit comments