doc: update devcontainer.json and add documentation

The previous .devcontainer.json configuration was outdated and
contained personal configurations that were not needed to run a
dev container. This updates the structure so that it's put in
.devcontainer/base/devcontainer.json based on the recommended
setup in GitHub's documentation. The official image now publishes
both arm64 and amd64 images, and devcontainer tools should be
able to pick up the right one without extra arguments.

This also adds documentation on how to use the container.

Refs: https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers#devcontainerjson
PR-URL: https://github.com/nodejs/node/pull/60472
Refs: https://github.com/nodejs/devcontainer
Refs: https://hub.docker.com/r/nodejs/devcontainer
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
Joyee Cheung
2025-11-03 19:26:58 +01:00
committed by GitHub
parent 641ec9bf45
commit ace8f6d60c
5 changed files with 153 additions and 26 deletions

8
.gitignore vendored
View File

@@ -7,7 +7,6 @@
.*
# Exclude specific dotfiles that we want to track.
!deps/**/.*
!.devcontainer.json
!test/fixtures/**/.*
!.clang-format
!.cpplint
@@ -167,3 +166,10 @@ __pycache__
# === Rules for C++ development ===
compile_commands.json
# === Dev Container rules ===
# Only track the shared base devcontainer.json; ignore everything else under .devcontainer
!.devcontainer/
.devcontainer/**
!.devcontainer/base/
!.devcontainer/base/devcontainer.json