Skip to content

Commit 82d7167

Browse files
authored
feat: update contributing.md with dev containers entry (#3977)
1 parent f94c190 commit 82d7167

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

docs-starlight/src/content/docs/03-community/01-contributing.md

+40
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,46 @@ Every source file in this project should be formatted with `go fmt`. There are f
302302

303303
To ensure that your changes get properly formatted, please install the git pre-commit hook with `make install-pre-commit-hook`.
304304

305+
### Development Containers
306+
307+
[Development Containers](https://containers.dev/) enable you to capture an entire development environment within a container. They can specify the required binaries, languages, extensions, and settings for a project. They can even define commands to run when entering the container. The [Dev Container spec](https://containers.dev/implementors/spec/) is met by a number of [supporting tools and editors](https://containers.dev/supporting), but here we demonstrate a Visual Studio Code example for contributing to the Terragrunt project.
308+
309+
1. Install the [Dev Containers VSCode extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).
310+
311+
2. Create a `.devcontainer.json` file at the project root. The example below launches a container configured with the appropriate version of Go, integrates the `golangci-lint` tool into the editor, installs the markdownlint extension with specific rules disabled (MD013 and MD024), includes Node.js and Terraform, and starts the Astro Starlight docs upon container startup.
312+
313+
```json
314+
{
315+
"name": "Terragrunt Contributing IDE",
316+
"image": "mcr.microsoft.com/devcontainers/go:1-1.23-bookworm",
317+
"runArgs": ["--network=host"],
318+
"customizations": {
319+
"vscode": {
320+
"settings": {
321+
"go.lintTool": "golangci-lint",
322+
"go.lintFlags": [
323+
"--fast"
324+
],
325+
"markdownlint.config": {
326+
"MD013": false,
327+
"MD024": false
328+
}
329+
},
330+
"extensions": [
331+
"davidanson.vscode-markdownlint"
332+
]
333+
}
334+
},
335+
"features": {
336+
"ghcr.io/devcontainers/features/node:1": {},
337+
"ghcr.io/devcontainers/features/terraform:1": {}
338+
},
339+
"postCreateCommand": "cd docs-starlight && npm install && npm run dev"
340+
}
341+
```
342+
343+
3. Open the project as a VSCode workspace and, when prompted, select `Reopen in Container`. If you miss the prompt, just open the command palette and run `Dev Containers: Rebuild and Reopen in Container`.
344+
305345
## Terragrunt Releases
306346

307347
Terragrunt releases follow [semantic versioning guidelines (semver)](https://semver.org/).

0 commit comments

Comments
 (0)