Skip to content

Commit 3196a30

Browse files
keyclaude
andcommitted
Add minimal Go app, post-create script, and update Dockerfile
- Add cmd/sigrok-mcp-server/main.go as minimal compilable entry point - Add go.mod for module initialization - Update Dockerfile to build from cmd/ layout and handle missing go.sum - Extract postCreateCommand into .devcontainer/post-create.sh script - Add Claude Code devcontainer feature and PATH config Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent aa26ca8 commit 3196a30

File tree

5 files changed

+44
-6
lines changed

5 files changed

+44
-6
lines changed

.devcontainer/devcontainer.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
1212
"ghcr.io/devcontainers/features/node:1": {
1313
"version": "lts"
14-
}
14+
},
15+
"ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {}
16+
},
17+
"remoteEnv": {
18+
"PATH": "${containerEnv:HOME}/.local/bin:${containerEnv:PATH}"
1519
},
1620
"customizations": {
1721
"vscode": {
@@ -44,6 +48,5 @@
4448
}
4549
},
4650
"remoteUser": "vscode",
47-
"postCreateCommand": "npm install -g markdownlint-cli2 && markdownlint-cli2 --version && echo 'Dev container ready!'",
48-
"postStartCommand": "test -w /go/pkg/mod || echo 'WARNING: Go module cache is not writable. Run: docker volume rm sigrok-mcp-server-go-mod-cache and rebuild the container.'"
49-
}
51+
"postCreateCommand": "bash .devcontainer/post-create.sh"
52+
}

.devcontainer/post-create.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Install global npm tools
5+
npm install -g markdownlint-cli2
6+
7+
# Verify all tools are available
8+
echo "--- Tool verification ---"
9+
sigrok-cli --version
10+
yamllint --version
11+
golangci-lint version
12+
gh --version
13+
node --version
14+
markdownlint-cli2 --version
15+
16+
# Check Go module cache volume permissions
17+
if [ ! -w /go/pkg/mod ]; then
18+
echo "WARNING: Go module cache is not writable. Run: docker volume rm sigrok-mcp-server-go-mod-cache and rebuild the container."
19+
fi
20+
21+
echo "Dev container ready!"

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ FROM golang:1.23-bookworm AS builder
33

44
WORKDIR /build
55

6-
COPY go.mod go.sum ./
6+
COPY go.mod go.sum* ./
77
RUN go mod download
88

99
COPY . .
10-
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /sigrok-mcp-server .
10+
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /sigrok-mcp-server ./cmd/sigrok-mcp-server
1111

1212
# Runtime stage
1313
FROM debian:bookworm-slim

cmd/sigrok-mcp-server/main.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"os"
6+
)
7+
8+
func main() {
9+
fmt.Fprintln(os.Stderr, "sigrok-mcp-server: not yet implemented")
10+
os.Exit(1)
11+
}

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/KenosInc/sigrok-mcp-server
2+
3+
go 1.23

0 commit comments

Comments
 (0)