chore: add devcontainer for codespaces/etc

This commit is contained in:
41666 2020-09-23 17:57:47 -04:00
parent 481a0bee31
commit afbb5b8269
2 changed files with 48 additions and 0 deletions

14
.devcontainer/Dockerfile Normal file
View file

@ -0,0 +1,14 @@
FROM mcr.microsoft.com/vscode/devcontainers/go:1.15
# Install Bazel
ARG BAZEL_VERSION=3.5.0
ARG BAZEL_DOWNLOAD_SHA=dev-mode
RUN curl -fSsL -o /tmp/bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh \
&& ([ "${BAZEL_DOWNLOAD_SHA}" = "dev-mode" ] || echo "${BAZEL_DOWNLOAD_SHA} */tmp/bazel-installer.sh" | sha256sum --check - ) \
&& /bin/bash /tmp/bazel-installer.sh --base=/usr/local/bazel \
&& rm /tmp/bazel-installer.sh
# Install Node.js
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

View file

@ -0,0 +1,34 @@
{
"name": "Roleypoly (Bazel, Go, Node)",
"build": {
"dockerfile": "Dockerfile",
"args": {
"BAZEL_VERSION": "3.5.0",
}
},
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"bazelbuild.vscode-bazel",
"dbaeumer.vscode-eslint",
"golang.go",
"hashicorp.terraform",
"firsttris.vscode-jest-runner",
"esbenp.prettier-vscode",
"zxh404.vscode-proto3",
"jpoissonnier.vscode-styled-components",
"eg2.vscode-npm-script",
"christian-kohler.npm-intellisense"
]
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}