-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdevcontainer.json
More file actions
74 lines (67 loc) · 1.94 KB
/
Copy pathdevcontainer.json
File metadata and controls
74 lines (67 loc) · 1.94 KB
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
70
71
72
73
74
{
"name": "Kosli CLI Development",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
// Configure tool-specific properties
"customizations": {
"vscode": {
"settings": {
"go.gopath": "/go",
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.lintTool": "golangci-lint",
"go.lintOnSave": "workspace",
"editor.formatOnSave": true,
"[go]": {
"editor.defaultFormatter": "golang.go",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
}
},
"extensions": [
"DavidAnson.vscode-markdownlint",
"eamodio.gitlens",
"golang.go",
"ms-azuretools.vscode-docker",
"ms-vscode.makefile-tools",
"yzhang.markdown-all-in-one"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally
"forwardPorts": [1515, 8001],
// Use 'postCreateCommand' to run commands after the container is created
"postCreateCommand": "go mod download && go install gotest.tools/gotestsum@latest",
// Features to add to the dev container
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"moby": true,
"dockerDashComposeVersion": "v2"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "lts",
"nodeGypDependencies": true,
"installYarnUsingApt": false
},
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "latest"
}
},
// Set environment variables
"remoteEnv": {
"CGO_ENABLED": "0",
"GO111MODULE": "on",
"GOPATH": "/go"
},
// Run as vscode user (non-root)
"remoteUser": "vscode",
// Mount docker socket and go module cache
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind",
"source=kosli-cli-gomod,target=/go/pkg/mod,type=volume"
]
}