diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..7ac963bd --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,25 @@ +FROM mcr.microsoft.com/devcontainers/base:bullseye + +# Install basic software that enables other software to be installed +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get install -y --no-install-recommends \ + curl apt-transport-https ca-certificates \ + gnupg \ + pkg-config \ + zip unzip \ + python \ + git + +# Install Bazel +ARG BAZELISK_VERSION=v1.10.1 +ARG BAZELISK_DOWNLOAD_SHA=dev-mode +RUN curl -fSsL -o /usr/local/bin/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/${BAZELISK_VERSION}/bazelisk-linux-amd64 \ + && ([ "${BAZELISK_DOWNLOAD_SHA}" = "dev-mode" ] || echo "${BAZELISK_DOWNLOAD_SHA} */usr/local/bin/bazelisk" | sha256sum --check - ) \ + && chmod 0755 /usr/local/bin/bazelisk \ + && ln -sf /usr/local/bin/bazelisk /usr/local/bin/bazel + +# Clean extraneous packages and files +RUN apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..879de62f --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,33 @@ +{ + "name": "Bazel (Community)", + "build": { + "dockerfile": "Dockerfile", + "args": { + "BAZELISK_VERSION": "v1.10.1", + "BAZELISK_DOWNLOAD_SHA": "4cb534c52cdd47a6223d4596d530e7c9c785438ab3b0a49ff347e991c210b2cd" + } + }, + "remoteUser": "vscode", + "features": { + "ghcr.io/devcontainers/features/common-utils:1": { + "installZsh": false, + "installOhMyZsh": false, + "upgradePackages": true + }, + "ghcr.io/devcontainers/features/go:1": {}, + "ghcr.io/devcontainers/features/node:1": {} + }, + + "settings": { + }, + + "customizations": { + "vscode": { + "extensions": [ + "dbaeumer.vscode-eslint", + "bazelbuild.vscode-bazel", + "golang.go" + ] + } + } +}