Skip to content

Commit 6d7ace3

Browse files
Add and document minimal devcontainers setup (#91)
1 parent 55e3208 commit 6d7ace3

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM mcr.microsoft.com/devcontainers/base:bookworm
2+
3+
# Download bazelisk and place it in $PATH
4+
RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64
5+
RUN chmod +x bazelisk-linux-amd64
6+
RUN mv bazelisk-linux-amd64 /usr/local/bin/bazel
7+
8+
# Install python3 and pip to setup pre-commit
9+
RUN apt update && apt install -y --no-install-recommends \
10+
python3-setuptools \
11+
python3-pip \
12+
python3-dev \
13+
python3-venv
14+
15+
# Install pre-commit
16+
RUN pip install --break-system-packages pre-commit

.devcontainer/devcontainer.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"build": {
3+
// instructs devcontainers to use a Dockerfile
4+
// rather than a pre-defined image
5+
"dockerfile": "Dockerfile"
6+
},
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"ms-azuretools.vscode-docker", // docker support
11+
"BazelBuild.vscode-bazel" // bazel support
12+
]
13+
}
14+
},
15+
// sets up pre-commit hooks
16+
"postStartCommand": "pre-commit install"
17+
}
18+

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# How to Contribute
22

3+
## Using devcontainers
4+
5+
If you are using [devcontainers](https://code.visualstudio.com/docs/devcontainers/containers)
6+
and/or [codespaces](https://github.com/features/codespaces) then you can start
7+
contributing immediately and skip the next step.
8+
39
## Formatting
410

511
Starlark files should be formatted by buildifier.

0 commit comments

Comments
 (0)