Skip to content

Commit 3ed7ab5

Browse files
XMTP Coder Agentclaude
andcommitted
Add devcontainer configuration for development environment
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>
1 parent 808663b commit 3ed7ab5

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "Go Dev Container",
3+
"build": {
4+
"context": "..",
5+
"dockerfile": "../dev/docker/devcontainer.Dockerfile"
6+
},
7+
"remoteEnv": {
8+
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}",
9+
"HOST_DOCKER_DEV_FOLDER": "${localWorkspaceFolder}/dev/docker"
10+
},
11+
"customizations": {
12+
"vscode": {
13+
"settings": {
14+
"go.gopath": "/go",
15+
"go.useLanguageServer": true
16+
},
17+
"extensions": [
18+
"golang.go",
19+
"ms-azuretools.vscode-docker"
20+
]
21+
}
22+
},
23+
"postCreateCommand": "go mod tidy",
24+
"forwardPorts": [],
25+
"remoteUser": "vscode",
26+
"features": {
27+
"ghcr.io/devcontainers/features/github-cli:1": {},
28+
"ghcr.io/devcontainers/features/common-utils:2": {
29+
"username": "vscode",
30+
"installZsh": true
31+
},
32+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
33+
"moby": false
34+
}
35+
}
36+
}

dev/docker/devcontainer.Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM golang:1.25
2+
3+
# Install golangci-lint
4+
RUN curl -sSfL https://golangci-lint.run/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.1.6
5+
6+
# Install buf CLI
7+
RUN go install github.com/bufbuild/buf/cmd/buf@latest
8+
9+
# Add shellcheck and jq
10+
RUN apt-get update && apt-get install -y \
11+
shellcheck \
12+
jq

0 commit comments

Comments
 (0)