Skip to content

Commit 1ffd950

Browse files
committed
Add default dev container (#76)
1 parent 254dde6 commit 1ffd950

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM mcr.microsoft.com/devcontainers/base:bullseye
2+
3+
# Install basic software that enables other software to be installed
4+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5+
&& apt-get install -y --no-install-recommends \
6+
curl apt-transport-https ca-certificates \
7+
gnupg \
8+
pkg-config \
9+
zip unzip \
10+
python \
11+
git
12+
13+
# Install Bazel
14+
ARG BAZELISK_VERSION=v1.10.1
15+
ARG BAZELISK_DOWNLOAD_SHA=dev-mode
16+
RUN curl -fSsL -o /usr/local/bin/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/${BAZELISK_VERSION}/bazelisk-linux-amd64 \
17+
&& ([ "${BAZELISK_DOWNLOAD_SHA}" = "dev-mode" ] || echo "${BAZELISK_DOWNLOAD_SHA} */usr/local/bin/bazelisk" | sha256sum --check - ) \
18+
&& chmod 0755 /usr/local/bin/bazelisk \
19+
&& ln -sf /usr/local/bin/bazelisk /usr/local/bin/bazel
20+
21+
# Clean extraneous packages and files
22+
RUN apt-get autoremove -y \
23+
&& apt-get clean -y \
24+
&& rm -rf /var/lib/apt/lists/*
25+

.devcontainer/devcontainer.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "Bazel (Community)",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": {
6+
"BAZELISK_VERSION": "v1.10.1",
7+
"BAZELISK_DOWNLOAD_SHA": "4cb534c52cdd47a6223d4596d530e7c9c785438ab3b0a49ff347e991c210b2cd"
8+
}
9+
},
10+
"remoteUser": "vscode",
11+
"features": {
12+
"ghcr.io/devcontainers/features/common-utils:1": {
13+
"installZsh": false,
14+
"installOhMyZsh": false,
15+
"upgradePackages": true
16+
},
17+
"ghcr.io/devcontainers/features/go:1": {},
18+
"ghcr.io/devcontainers/features/node:1": {}
19+
},
20+
21+
"settings": {
22+
},
23+
24+
"customizations": {
25+
"vscode": {
26+
"extensions": [
27+
"dbaeumer.vscode-eslint",
28+
"bazelbuild.vscode-bazel",
29+
"golang.go"
30+
]
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)