Skip to content

Commit

Permalink
Add and document minimal devcontainers setup (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGrizzlyDev authored Jan 26, 2024
1 parent 55e3208 commit 6d7ace3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM mcr.microsoft.com/devcontainers/base:bookworm

# Download bazelisk and place it in $PATH
RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64
RUN chmod +x bazelisk-linux-amd64
RUN mv bazelisk-linux-amd64 /usr/local/bin/bazel

# Install python3 and pip to setup pre-commit
RUN apt update && apt install -y --no-install-recommends \
python3-setuptools \
python3-pip \
python3-dev \
python3-venv

# Install pre-commit
RUN pip install --break-system-packages pre-commit
18 changes: 18 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"build": {
// instructs devcontainers to use a Dockerfile
// rather than a pre-defined image
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.vscode-docker", // docker support
"BazelBuild.vscode-bazel" // bazel support
]
}
},
// sets up pre-commit hooks
"postStartCommand": "pre-commit install"
}

6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# How to Contribute

## Using devcontainers

If you are using [devcontainers](https://code.visualstudio.com/docs/devcontainers/containers)
and/or [codespaces](https://github.com/features/codespaces) then you can start
contributing immediately and skip the next step.

## Formatting

Starlark files should be formatted by buildifier.
Expand Down

0 comments on commit 6d7ace3

Please sign in to comment.