summaryrefslogtreecommitdiffstats
path: root/.devcontainer/devcontainer.json
blob: 73f37e3eccaaf13c5d291cd9cf7bd7f9363cd8fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// adapted from https://github.com/devcontainers/images/blob/main/src/go/.devcontainer/devcontainer.json
{
  "build": {
      "dockerfile": "./Dockerfile",
      "context": "."
  },
  "features": {
      "ghcr.io/devcontainers/features/common-utils:1": {
          "installZsh": "true",
          "username": "vscode",
          "uid": "1000",
          "gid": "1000",
          "upgradePackages": "true"
      },
      "ghcr.io/devcontainers/features/go:1": {
          "version": "none"
      },
      "ghcr.io/devcontainers/features/git:1": {
          "version": "latest",
          "ppa": "false"
      }
  },
  "overrideFeatureInstallOrder": [
      "ghcr.io/devcontainers/features/common-utils"
  ],
  // not sure if we actually need these
  "runArgs": [
      "--cap-add=SYS_PTRACE",
      "--security-opt",
      "seccomp=unconfined"
  ],
  // Configure tool-specific properties.
  "customizations": {
      // Configure properties specific to VS Code.
      "vscode": {
          // Set *default* container specific settings.json values on container create.
          "settings": {
              "go.toolsManagement.checkForUpdates": "local",
              "go.useLanguageServer": true,
              "go.gopath": "/go",
              "[go]": {
                "editor.formatOnSave": true,
                "editor.codeActionsOnSave": {
                  "source.organizeImports": true
                }
              },
              "go.lintTool": "golangci-lint",
              "gopls": {
                "formatting.gofumpt": true,
                "usePlaceholders": false // add parameter placeholders when completing a function
              },
              "files.eol": "\n"
          },
          // Add the IDs of extensions you want installed when the container is created.
          "extensions": [
              "golang.Go"
          ]
      }
  },
  // Use 'postCreateCommand' to run commands after the container is created.
  // "postCreateCommand": "go version",

  // See https://www.kenmuse.com/blog/avoiding-dubious-ownership-in-dev-containers/ for the safe.directory part
  // The defaultBranch part is required for our deprecated integration tests.
  "postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder} && git config --global init.defaultBranch master",

  // Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
  "remoteUser": "vscode"
}