From 31c6551cce908103eea73e0d784f7f8e1db990bf Mon Sep 17 00:00:00 2001 From: James Wells Date: Thu, 24 Mar 2022 11:31:52 -0700 Subject: [PATCH] Updated devcontainer. --- .devcontainer/devcontainer.json | 69 +++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 16 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9ab51d0..7895f39 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,18 +1,55 @@ +// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/go { - "name": "GitHub Codespaces (Default)", - "extensions": [ - "GitHub.vscode-pull-request-github", - "golang.go", - "hashicorp.terraform", - "wholroyd.hcl", - "github.copilot", - "golang.Go" - ], - "build": { - "dockerfile": "Dockerfile", - "args": { - "VARIANT": "1.17", - "NODE_VERSION": "none" - } - }, + "name": "Go", + "build": { + "dockerfile": "Dockerfile", + "args": { + // Update the VARIANT arg to pick a version of Go: 1, 1.16, 1.17 + // Append -bullseye or -buster to pin to an OS version. + // Use -bullseye variants on local arm64/Apple Silicon. + "VARIANT": "1.18-bullseye", + // Options + "NODE_VERSION": "none" + } + }, + "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], + + // Set *default* container specific settings.json values on container create. + "settings": { + "go.toolsManagement.checkForUpdates": "local", + "go.useLanguageServer": true, + "go.gopath": "/go", + "go.goroot": "/usr/local/go" + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "golang.Go", + "GitHub.copilot", + "GitHub.vscode-pull-request-github", + "wholroyd.hcl", + ], + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [9000], + + // Use 'portsAttributes' to set default properties for specific forwarded ports. More info: https://code.visualstudio.com/docs/remote/devcontainerjson-reference. + "portsAttributes": { + "9000": { + "label": "Hello Remote World", + "onAutoForward": "notify" + } + }, + + // Use 'otherPortsAttributes' to configure any ports that aren't configured using 'portsAttributes'. + // "otherPortsAttributes": { + // "onAutoForward": "silent" + // }, + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "go version", + + // Uncomment to connect as a non-root user. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" }