Conversation
Sets up a devcontainer with Go 1.25, golangci-lint v2, buf CLI, gopls (via Go extension), shellcheck, and Docker-in-Docker (non-Moby), following the xmtpd repo pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| "installZsh": true | ||
| }, | ||
| "ghcr.io/devcontainers/features/docker-in-docker:2": { | ||
| "moby": false |
There was a problem hiding this comment.
Have you verified that docker commands succeed from inside the devcontainer in this repo?
WalkthroughAdded Dev Container configuration files to establish a containerized Go development environment with essential tooling. Includes a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
dev/docker/devcontainer.Dockerfile (1)
9-12: Consider adding apt cleanup to reduce image size.This is optional for a dev container, but adding
--no-install-recommendsand cleaning up the apt cache would reduce the image footprint.Optional cleanup
# Add shellcheck and jq -RUN apt-get update && apt-get install -y \ +RUN apt-get update && apt-get install -y --no-install-recommends \ shellcheck \ - jq + jq \ + && rm -rf /var/lib/apt/lists/*🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@dev/docker/devcontainer.Dockerfile` around lines 9 - 12, The RUN step installing shellcheck and jq should avoid extra packages and remove apt caches to shrink the image; update the RUN that installs these tools (the Dockerfile RUN that lists shellcheck and jq) to use --no-install-recommends during apt-get install and add apt cleanup commands after install (apt-get clean and removal of /var/lib/apt/lists/*) so the image does not retain package cache.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@dev/docker/devcontainer.Dockerfile`:
- Around line 6-7: Replace the non-deterministic installation of buf (RUN go
install github.com/bufbuild/buf/cmd/buf@latest) with a pinned released tag;
update the Dockerfile line to use a specific buf CLI version (for example
replace `@latest` with `@vX.Y.Z`) so the build is reproducible and consistent with
the pinned plugin versions (identify the RUN line installing buf in the
Dockerfile to change).
---
Nitpick comments:
In `@dev/docker/devcontainer.Dockerfile`:
- Around line 9-12: The RUN step installing shellcheck and jq should avoid extra
packages and remove apt caches to shrink the image; update the RUN that installs
these tools (the Dockerfile RUN that lists shellcheck and jq) to use
--no-install-recommends during apt-get install and add apt cleanup commands
after install (apt-get clean and removal of /var/lib/apt/lists/*) so the image
does not retain package cache.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 87cb3c39-4bb6-41a2-9497-6331dcb570fa
📒 Files selected for processing (2)
.devcontainer/devcontainer.jsondev/docker/devcontainer.Dockerfile
| # Install buf CLI | ||
| RUN go install github.com/bufbuild/buf/cmd/buf@latest |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
What is the latest stable version of buf CLI in March 2026?
💡 Result:
The latest stable version of the buf CLI in March 2026 is v1.66.1, released on 2026-03-09.
Citations:
- 1: https://github.com/bufbuild/buf/releases
- 2: https://buf.build/docs/installation
- 3: https://pkg.go.dev/github.com/bufbuild/buf
- 4: https://www.npmjs.com/package/@bufbuild/buf
🏁 Script executed:
# Check if the Dockerfile exists and examine the relevant lines
if [ -f "dev/docker/devcontainer.Dockerfile" ]; then
echo "=== dev/docker/devcontainer.Dockerfile exists ==="
head -20 dev/docker/devcontainer.Dockerfile
else
echo "File not found: dev/docker/devcontainer.Dockerfile"
fiRepository: xmtp/example-notification-server-go
Length of output: 429
🏁 Script executed:
# Check if proto/buf.gen.yaml exists and examine its content
if [ -f "proto/buf.gen.yaml" ]; then
echo "=== proto/buf.gen.yaml exists ==="
cat proto/buf.gen.yaml
else
echo "File not found: proto/buf.gen.yaml"
fiRepository: xmtp/example-notification-server-go
Length of output: 869
Pin the buf CLI version for reproducibility.
Using @latest risks breaking the build if buf CLI introduces breaking changes. The proto/buf.gen.yaml already pins specific plugin versions (e.g., buf.build/protocolbuffers/go:v1.36.6, buf.build/connectrpc/go:v1.19.1), so the CLI should also be pinned for consistency and reproducibility.
Proposed fix
# Install buf CLI
-RUN go install github.com/bufbuild/buf/cmd/buf@latest
+RUN go install github.com/bufbuild/buf/cmd/buf@v1.66.1📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Install buf CLI | |
| RUN go install github.com/bufbuild/buf/cmd/buf@latest | |
| # Install buf CLI | |
| RUN go install github.com/bufbuild/buf/cmd/buf@v1.66.1 |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@dev/docker/devcontainer.Dockerfile` around lines 6 - 7, Replace the
non-deterministic installation of buf (RUN go install
github.com/bufbuild/buf/cmd/buf@latest) with a pinned released tag; update the
Dockerfile line to use a specific buf CLI version (for example replace `@latest`
with `@vX.Y.Z`) so the build is reproducible and consistent with the pinned plugin
versions (identify the RUN line installing buf in the Dockerfile to change).
Resolves #67
Summary
.devcontainer/devcontainer.jsonanddev/docker/devcontainer.Dockerfilefollowing the xmtpd devcontainer patternWhat's included
go.moddev/.golangci.yamldev/gen-proto)golang.goVS Code extensiondev/lint-shellcheck./dev/upand integration testsTest plan
devcontainer build --workspace-folder .completes successfully🤖 Generated with Claude Code
Note
Add VS Code Dev Container configuration for Go development
golang.goandms-azuretools.vscode-dockerextensions, andgo mod tidyas a post-create command.golang:1.25, installinggolangci-lintv2.1.6,buf,shellcheck, andjq.vscoderemote user.Macroscope summarized 3ed7ab5.
Summary by CodeRabbit