1
+ {
2
+ "name" : " Go" ,
3
+ "build" : {
4
+ "dockerfile" : " Dockerfile" ,
5
+ "args" : {
6
+ // Update the VARIANT arg to pick a version of Go: 1, 1.16, 1.17
7
+ // Append -bullseye or -buster to pin to an OS version.
8
+ // Use -bullseye variants on local arm64/Apple Silicon.
9
+ "VARIANT" : " 1.17-bullseye" ,
10
+ // Options
11
+ "NODE_VERSION" : " none"
12
+ }
13
+ },
14
+ "runArgs" : [" --cap-add=SYS_PTRACE" , " --security-opt" , " seccomp=unconfined" ],
15
+
16
+ // Set *default* container specific settings.json values on container create.
17
+ "settings" : {
18
+ "go.toolsManagement.checkForUpdates" : " local" ,
19
+ "go.useLanguageServer" : true ,
20
+ "go.gopath" : " /go" ,
21
+ "terminal.integrated.defaultProfile.linux" : " zsh" ,
22
+ "terminal.integrated.defaultProfile.osx" : " zsh" ,
23
+ "terminal.integrated.defaultProfile.windows" : " zsh" ,
24
+ },
25
+
26
+ // Add the IDs of extensions you want installed when the container is created.
27
+ "extensions" : [
28
+ " golang.Go" ,
29
+ " eamodio.gitlens" ,
30
+ " mohsen1.prettify-json" ,
31
+ " zxh404.vscode-proto3" ,
32
+ " bierner.markdown-preview-github-styles" ,
33
+ " cschleiden.vscode-github-actions" ,
34
+ " redhat.vscode-yaml" ,
35
+ " carlos-algms.make-task-provider" ,
36
+ " streetsidesoftware.code-spell-checker" ,
37
+ " k--kato.intellij-idea-keybindings" ,
38
+ " donjayamanne.githistory" ,
39
+ " github.vscode-pull-request-github"
40
+ ],
41
+
42
+ "remoteEnv" : {
43
+ "GOPROXY" : " https://goproxy.cn,direct" ,
44
+ },
45
+
46
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
47
+ "forwardPorts" : [16600 ],
48
+
49
+ "portsAttributes" : {
50
+ "16600" : {
51
+ "label" : " HTTP Port" ,
52
+ "onAutoForward" : " openBrowserOnce" ,
53
+ }
54
+ },
55
+
56
+ // Use 'postCreateCommand' to run commands after the container is created.
57
+ "postCreateCommand" : " go mod download" ,
58
+
59
+ // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
60
+ // "remoteUser": "vscode",
61
+ // "workspaceFolder": "/workspace/project",
62
+ // "workspaceMount": "source=/home/admin/workspace/project,target=/workspace/project,type=bind,consistency=cached"
63
+ }
0 commit comments