|
1 | 1 | { |
2 | 2 | "name": "retina", |
3 | | - "image": "mcr.microsoft.com/devcontainers/base:jammy", |
| 3 | + "image": "mcr.microsoft.com/devcontainers/base:noble", |
4 | 4 | "features": { |
5 | | - "ghcr.io/devcontainers/features/common-utils:2": {}, |
6 | | - "ghcr.io/devcontainers/features/docker-in-docker:2": {}, |
7 | | - "ghcr.io/devcontainers/features/github-cli:1": {}, |
8 | | - "ghcr.io/devcontainers/features/go:1": {}, |
9 | | - "ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {}, |
10 | | - "ghcr.io/devcontainers-contrib/features/kind:1": {}, |
11 | | - "ghcr.io/devcontainers/features/azure-cli:1": {} |
| 5 | + "ghcr.io/devcontainers/features/docker-in-docker:2.16.1": {}, |
| 6 | + "ghcr.io/devcontainers/features/github-cli:1.1.0": {}, |
| 7 | + "ghcr.io/devcontainers/features/go:1.3.4": { |
| 8 | + "version": "1.24.11" |
| 9 | + }, |
| 10 | + "ghcr.io/devcontainers/features/kubectl-helm-minikube:1.3.1": {}, |
| 11 | + "ghcr.io/devcontainers-extra/features/kind:1.0.15": {}, |
| 12 | + "ghcr.io/devcontainers/features/azure-cli:1.2.9": {}, |
| 13 | + // LLVM 17 is the minimum version available for Ubuntu Noble on apt.llvm.org. |
| 14 | + // Provides clang and llvm-strip needed for eBPF compilation. |
| 15 | + "ghcr.io/devcontainers-community/features/llvm:3.2.0": { |
| 16 | + "version": "17" |
| 17 | + } |
| 18 | + }, |
| 19 | + "hostRequirements": { |
| 20 | + "cpus": 4, |
| 21 | + "memory": "8gb", |
| 22 | + "storage": "32gb" |
| 23 | + }, |
| 24 | + // Persist Go module and build caches across container rebuilds. |
| 25 | + "mounts": [ |
| 26 | + { |
| 27 | + "type": "volume", |
| 28 | + "source": "retina-gomodcache", |
| 29 | + "target": "/go/pkg/mod" |
| 30 | + }, |
| 31 | + { |
| 32 | + "type": "volume", |
| 33 | + "source": "retina-gobuildcache", |
| 34 | + "target": "/home/vscode/.cache/go-build" |
| 35 | + } |
| 36 | + ], |
| 37 | + // These commands run in parallel during container creation. |
| 38 | + "onCreateCommand": { |
| 39 | + // The LLVM feature installs versioned binaries (clang-17, llvm-strip-17). |
| 40 | + // Create unversioned symlinks so the build system can find them. |
| 41 | + "symlinks": "sudo ln -sf /usr/bin/clang-17 /usr/bin/clang && sudo ln -sf /usr/bin/llvm-strip-17 /usr/bin/llvm-strip", |
| 42 | + // Fix ownership of volume mounts (created as root) and cache dirs, |
| 43 | + // then download Go modules. |
| 44 | + "go-setup": "sudo chown -R vscode:vscode /go /home/vscode/.cache && go mod download", |
| 45 | + // Install jq (needed by some Makefile targets and scripts). |
| 46 | + "apt-deps": "sudo apt-get update && sudo apt-get install -y --no-install-recommends jq && sudo rm -rf /var/lib/apt/lists/*" |
| 47 | + }, |
| 48 | + // Wait for Docker-in-Docker to be ready, then create a Kind cluster for local testing. |
| 49 | + "postStartCommand": { |
| 50 | + "kind": "while ! docker info >/dev/null 2>&1; do sleep 1; done && kind create cluster 2>/dev/null || true" |
| 51 | + }, |
| 52 | + "waitFor": "onCreateCommand", |
| 53 | + "forwardPorts": [ |
| 54 | + 9965, |
| 55 | + 4244, |
| 56 | + 10093 |
| 57 | + ], |
| 58 | + "portsAttributes": { |
| 59 | + "9965": { |
| 60 | + "label": "Hubble Metrics", |
| 61 | + "onAutoForward": "silent" |
| 62 | + }, |
| 63 | + "4244": { |
| 64 | + "label": "Hubble Relay", |
| 65 | + "onAutoForward": "silent" |
| 66 | + }, |
| 67 | + "10093": { |
| 68 | + "label": "Retina Metrics", |
| 69 | + "onAutoForward": "silent" |
| 70 | + } |
12 | 71 | }, |
13 | | - "postCreateCommand": "bash .devcontainer/installMoreTools.sh && kind create cluster", |
14 | 72 | "customizations": { |
15 | 73 | "vscode": { |
16 | 74 | "extensions": [ |
17 | | - "esbenp.prettier-vscode", |
18 | 75 | "golang.go", |
19 | | - "mutantdino.resourcemonitor", |
20 | 76 | "ms-vscode.makefile-tools", |
21 | | - "ms-kubernetes-tools.vscode-kubernetes-tools" |
22 | | - ] |
| 77 | + "ms-kubernetes-tools.vscode-kubernetes-tools", |
| 78 | + "ms-azuretools.vscode-docker", |
| 79 | + "redhat.vscode-yaml", |
| 80 | + "mutantdino.resourcemonitor", |
| 81 | + "DavidAnson.vscode-markdownlint" |
| 82 | + ], |
| 83 | + "settings": { |
| 84 | + "go.lintTool": "golangci-lint", |
| 85 | + "go.lintFlags": [ |
| 86 | + "--config=.golangci.yaml", |
| 87 | + "--timeout=10m" |
| 88 | + ], |
| 89 | + "go.formatTool": "gofumpt", |
| 90 | + "files.insertFinalNewline": true, |
| 91 | + "markdownlint.config": { |
| 92 | + "extends": ".github/.markdownlint.json" |
| 93 | + }, |
| 94 | + "[markdown]": { |
| 95 | + "editor.codeActionsOnSave": { |
| 96 | + "source.fixAll.markdownlint": "explicit" |
| 97 | + } |
| 98 | + } |
| 99 | + } |
23 | 100 | } |
24 | 101 | } |
25 | 102 | } |
0 commit comments