1- -y // For format details, see https://aka.ms/vscode-remote/ devcontainer.json or this file's README at:
2- // https://github.com/microsoft/vscode-dev-containers /tree/v0.117.1/containers /go
1+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+ // README at: https://github.com/devcontainers/templates /tree/main/src /go
33{
4- "name" : " devcontainer-cli " ,
5- "dockerFile" : " Dockerfile" ,
4+ "name" : " devcontainerx " ,
5+ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
66 "build" : {
7- "cacheFrom" : " ghcr.io/stuartleeks/devcontainer-cli-devcontainer" ,
8- "args" : {
9- // To ensure that the group ID for the docker group in the container
10- // matches the group ID on the host, add this to your .bash_profile on the host
11- // export DOCKER_GROUP_ID=$(getent group docker | awk -F ":" '{ print $3 }')
12- "DOCKER_GROUP_ID" : " ${localEnv:DOCKER_GROUP_ID}"
13- }
7+ // Path is relataive to the devcontainer.json file.
8+ "dockerfile" : " Dockerfile"
149 },
15- "runArgs" : [
16- // Uncomment the next line to use a non-root user. On Linux, this will prevent
17- // new files getting created as root, but you may need to update the USER_UID
18- // and USER_GID in .devcontainer/Dockerfile to match your user if not 1000.
19- // "-u", "vscode",
20- " --cap-add=SYS_PTRACE" ,
21- " --security-opt" ,
22- " seccomp=unconfined" ,
23-
24- // Mount go mod cache
25- " -v" , " devcontainer-cli-gomodcache:/go/pkg" ,
26- // Use host network
27- " --network=host" ,
28- ],
29-
30- // Set *default* container specific settings.json values on container create.
31- "settings" : {
32- "terminal.integrated.shell.linux" : " /bin/bash" ,
33- "go.gopath" : " /go" ,
34- "go.useLanguageServer" : true ,
35- "[go]" : {
36- "editor.snippetSuggestions" : " none" ,
37- "editor.formatOnSave" : true ,
38- "editor.codeActionsOnSave" : {
39- "source.organizeImports" : true ,
40- }
41- },
42- "gopls" : {
43- "usePlaceholders" : true , // add parameter placeholders when completing a function
44- // Experimental settings
45- "completeUnimported" : true , // autocomplete unimported packages
46- "deepCompletion" : true , // enable deep completion
10+ "features" : {
11+ "ghcr.io/devcontainers/features/docker-outside-of-docker" : {},
12+ "ghcr.io/stuartleeks/dev-container-features/shell-history:0" : {},
13+ "ghcr.io/guiyomh/features/golangci-lint:0" : {
14+ "version" : " latest"
4715 },
48- "files.eol" : " \n " , // formatting only supports LF line endings
16+ "ghcr.io/guiyomh/features/goreleaser:0" : {
17+ "version" : " 1.15.2"
18+ }
4919 },
50-
51- // Add the IDs of extensions you want installed when the container is created.
52- "extensions" : [
53- " golang.go" ,
54- " stuartleeks.vscode-go-by-example" ,
55- " darkriszty.markdown-table-prettify" ,
56- " davidanson.vscode-markdownlint" ,
57- " mushan.vscode-paste-image"
58- ,
59- " ms-azuretools.vscode-docker" ,],
60-
6120 // Use 'forwardPorts' to make a list of ports inside the container available locally.
6221 // "forwardPorts": [],
63-
6422 // Use 'postCreateCommand' to run commands after the container is created.
6523 "postCreateCommand" : " make post-create" ,
66-
67- // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
68- "remoteUser" : " vscode" ,
69- "mounts" : [
70- // Keep command history
71- " source=devcontainer-cli-bashhistory,target=/home/vscode/commandhistory" ,
72- // Mounts the .config/gh host folder into the dev container to pick up host gh CLI login details
73- // NOTE that mounting directly to ~/.config/gh makes ~/.config only root-writable
74- // Instead monut to another location and symlink in Dockerfile
75- " type=bind,source=${env:HOME}${env:USERPROFILE}/.config/gh,target=/config/gh" ,
76- // Mounts the .azure host folder into the dev container to pick up host az CLI login details
77- " type=bind,source=${env:HOME}${env:USERPROFILE}/.azure,target=/home/vscode/.azure" ,
78- // Mount host docker socket
79- " type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock" ,
80- ],
24+ // Configure tool-specific properties.
25+ "customizations" : {
26+ // TODO
27+ "extensions" : [
28+ " golang.go" ,
29+ " stuartleeks.vscode-go-by-example" ,
30+ " darkriszty.markdown-table-prettify" ,
31+ " davidanson.vscode-markdownlint" ,
32+ " mushan.vscode-paste-image" ,
33+ " ms-azuretools.vscode-docker" ,
34+ ],
35+ },
36+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
37+ // "remoteUser": "root"
8138}
0 commit comments