Skip to content

Add dev container configuration#1434

Merged
lpcox merged 1 commit intomainfrom
lpcox/new-dev-container
Feb 26, 2026
Merged

Add dev container configuration#1434
lpcox merged 1 commit intomainfrom
lpcox/new-dev-container

Conversation

@lpcox
Copy link
Collaborator

@lpcox lpcox commented Feb 26, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 26, 2026 16:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a VS Code Dev Container setup to standardize local development for MCP Gateway contributors and make it easier to run/build/lint/test inside a containerized environment.

Changes:

  • Introduces .devcontainer/devcontainer.json with Go-focused VS Code settings, extensions, and port forwarding.
  • Adds a .devcontainer/Dockerfile to build a Go 1.25-based dev image, install tooling, and warm the Go module cache.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.devcontainer/devcontainer.json Defines the devcontainer build, features (DinD, GitHub CLI), VS Code settings/extensions, and forwarded ports.
.devcontainer/Dockerfile Builds the devcontainer image, installs golangci-lint and common CLI tools, and pre-downloads Go modules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +6 to +7
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| sh -s -- -b /usr/local/bin ${GOLANGCI_LINT_VERSION}
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants