Skip to content

Commit

Permalink
Update devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Fasching authored and Matthias Fasching committed Sep 6, 2021
1 parent 53c6b8d commit 1ed5433
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
9 changes: 4 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/go/.devcontainer/base.Dockerfile

# [Choice] Go version: 1, 1.16, 1.15
ARG VARIANT="1.16"
ARG VARIANT="1.17"
FROM mcr.microsoft.com/vscode/devcontainers/go:0-${VARIANT}

# [Option] Install Node.js
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
Expand Down
15 changes: 10 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,35 @@
"dockerfile": "Dockerfile",
"args": {
// Update the VARIANT arg to pick a version of Go: 1, 1.16, 1.15
"VARIANT": "1.16",
"VARIANT": "1.17",
// Options
"INSTALL_NODE": "false",
"NODE_VERSION": "lts/*"
"NODE_VERSION": "none"
}
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
"mounts": [
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,destination=/home/vscode/.ssh,type=bind,readonly",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,destination=/root/.ssh,type=bind,readonly"
],
// Set *default* container specific settings.json values on container create.
"settings": {
"editor.formatOnSave": true,
"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": [
"streetsidesoftware.code-spell-checker",
"eamodio.gitlens",
"golang.Go",
"davidanson.vscode-markdownlint",
"ms-vsliveshare.vsliveshare",
"streetsidesoftware.code-spell-checker",
"vscode-icons-team.vscode-icons"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
Expand Down

0 comments on commit 1ed5433

Please sign in to comment.