Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 22 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Dev container for MCP Gateway (Go 1.25)
FROM mcr.microsoft.com/devcontainers/go:1.25-bookworm

# Install golangci-lint
ARG GOLANGCI_LINT_VERSION=v2.8.0
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| sh -s -- -b /usr/local/bin ${GOLANGCI_LINT_VERSION}
Comment on lines +6 to +7
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The devcontainer installs golangci-lint by piping a script from the master branch of an external repo into sh. This is not reproducible and increases supply-chain risk (the script contents can change without any version bump). Prefer downloading a specific released artifact (or pinning the installer script to a commit) and verifying checksums/signatures so the devcontainer build is deterministic.

Suggested change
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| sh -s -- -b /usr/local/bin ${GOLANGCI_LINT_VERSION}
ARG GOLANGCI_LINT_CHECKSUM=REPLACE_WITH_SHA256_FOR_v2_8_0_LINUX_AMD64
RUN set -eux; \
arch="$(uname -m)"; \
case "$arch" in \
x86_64) golangci_arch="amd64" ;; \
aarch64) golangci_arch="arm64" ;; \
*) echo "Unsupported architecture: $arch" >&2; exit 1 ;; \
esac; \
version="${GOLANGCI_LINT_VERSION#v}"; \
url="https://github.com/golangci/golangci-lint/releases/download/${GOLANGCI_LINT_VERSION}/golangci-lint-${version}-linux-${golangci_arch}.tar.gz"; \
curl -sSfL "$url" -o /tmp/golangci-lint.tar.gz; \
echo "${GOLANGCI_LINT_CHECKSUM} /tmp/golangci-lint.tar.gz" | sha256sum -c -; \
tar -xzf /tmp/golangci-lint.tar.gz -C /tmp; \
mv "/tmp/golangci-lint-${version}-linux-${golangci_arch}/golangci-lint" /usr/local/bin/; \
rm -rf /tmp/golangci-lint*

Copilot uses AI. Check for mistakes.

# Install useful CLI tools
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
jq \
bash-completion \
&& apt-get autoremove -y && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# Pre-download Go modules for faster first build
WORKDIR /tmp/modcache
COPY go.mod go.sum ./
RUN go mod download && rm -rf /tmp/modcache

WORKDIR /workspaces
51 changes: 51 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "MCP Gateway Dev",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": true,
"installDockerBuildx": true
},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"customizations": {
"vscode": {
"settings": {
"go.toolsManagement.autoUpdate": true,
"go.useLanguageServer": true,
"go.lintTool": "golangci-lint",
"go.lintFlags": ["--timeout=5m"],
"go.testFlags": ["-v"],
"editor.formatOnSave": true,
"[go]": {
"editor.defaultFormatter": "golang.go",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true
},
"extensions": [
"golang.go",
"GitHub.copilot",
"GitHub.copilot-chat",
"eamodio.gitlens",
"ms-azuretools.vscode-docker"
]
}
},
"postCreateCommand": "make install",
"remoteUser": "vscode",
"forwardPorts": [3000, 8000],
"portsAttributes": {
"3000": { "label": "MCP Gateway", "onAutoForward": "notify" },
"8000": { "label": "MCP Gateway (alt)", "onAutoForward": "notify" }
},
"remoteEnv": {
"DEBUG": ""
}
}