Skip to content

Commit 407f96c

Browse files
committed
docs: Add new DevContainer reference pages and journal entries for December 20, 2025
- Created index pages for DevContainer keys and variables, including detailed documentation for `onCreateCommand` and `containerWorkspaceFolder`. - Updated existing pages with notes on JetBrains DevContainer examples and multi-environment setups. - Documented personal experiences using RustRover within a DevContainer, highlighting challenges and useful resources. - Added a comprehensive report on multi-environment DevContainer setups, including best practices and real-world examples from various projects.
1 parent 796fde0 commit 407f96c

12 files changed

+163
-1
lines changed

journals/2025_12_20.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- Created [[DevContainer/Ref/Key]] and [[DevContainer/Ref/Variable]] index pages with prototype entries for `onCreateCommand` key and `containerWorkspaceFolder` variable to document devcontainer.json configuration
2+
- Updated [[JetBrains/DevContainer/Example]] with note about the specification examples folder containing examples of various devcontainer spec parts like `remoteUser`, `remoteEnv`, etc.
3+
- Today I started using [[JetBrains/RustRover]] inside of a [[DevContainer]]
4+
- [[Keyshort]] Opt+Shift+Ctrl+C doesn't copy path / reference in such a way that Cmd+V pastes it
5+
- [Dev Container CLI | RustRover Documentation](https://www.jetbrains.com/help/rust/dev-container-cli.html?#build_container)
6+
- it turns out that jetbrains has [[JetBrains/DevContainer/ijdevc]] which is a [[CLI/Tool]] (that presumably wraps the canonical `dev-container` CLI or implements the spec independently)
7+
- I was unable to install it. Basically, the instructions didn't work out of the box so I gave up. I didn't try very hard because I was unconvinced that it would solve my problems or give me capabilities I needed.
8+
- ## examples of projects with multiple [[DevContainer/.devcontainer.json]]s in the repo
9+
- [[DevContainer/Report/25/12/Multi-Env DevContainer Setup]]
10+
- [[TheRedGuild/GitHub/devcontainer]] some security-focused devcontainers, each in a sub-folder of `.devcontainer`
11+
- [[Mastodon/GitHub/mastodon/.devcontainer]] has a default `.devcontainer.json` and one focused on [[Codespaces]], each sharing a [[Docker/Compose/docker-compose.yml]]
12+
- [[Discourse/GitHub/discourse/.devcontainer]]
13+
- [[Rust]] analysis and [[Performance]]
14+
- [2025-11-10 InterpN: Fast Interpolation - James Logan's Personal Site](https://jlogan.dev/blog/2025/11/10/2025-11-10-interpn-fast-interpolation/)
15+
- > InterpN achieves up to 200x speedup over the state of the art (Scipy) for N-dimensional interpolation.
16+
-

pages/DevContainer.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ title:: DevContainer
99
- ## Key Concepts
1010
- [[DevContainer/Docker Compose/Concept/Using Docker Compose]] - Multi-container development with Docker Compose
1111
- [[DevContainer/Feature/Concept/Docker Build Order]] - How features map to Docker layers
12+
- ## Reference
13+
- [[DevContainer/Ref/Key]] - Configuration keys for `devcontainer.json`
14+
- [[DevContainer/Ref/Variable]] - Variables available in `devcontainer.json`
1215
- ## Language-Specific Configuration
1316
- [[DevContainer/Rust/How To/Configure Debugging]] - Configuring Rust debugging with ptrace
1417
- ## Competitors and Interacting Standards

pages/DevContainer___Ref___Key.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
- # DevContainer Keys Reference
2+
- Configuration keys that can be used in `devcontainer.json` files
3+
- ## Lifecycle Hooks
4+
- [[DevContainer/Ref/Key/onCreateCommand]] - Command to run when the container is created
5+
- *More lifecycle hooks will be added here as they are documented*
6+
- ## Container Configuration
7+
- *Container configuration keys will be added here as they are documented*
8+
- ## Feature Configuration
9+
- *Feature configuration keys will be added here as they are documented*
10+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
- # Key: onCreateCommand
2+
- ## Description
3+
- A command that runs when the dev container is created (after the container image is built or pulled, and the container is created and started)
4+
- Runs only once per container creation, not on every container start
5+
- ## Type
6+
- `string` or `array` of strings
7+
- ## Usage
8+
- Useful for one-time setup tasks like configuring Git safe directories
9+
- Example:
10+
- ~~~
11+
"onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}"
12+
~~~
13+
- Can also be an array of commands:
14+
- ~~~
15+
"onCreateCommand": [
16+
"command1",
17+
"command2"
18+
]
19+
~~~
20+
- ## Context
21+
- This is a lifecycle hook that runs during container initialization
22+
- Different from `postCreateCommand` which runs after the container is created and the workspace is opened
23+
- Different from `postStartCommand` which runs every time the container starts
24+
- ## Common Use Cases
25+
- Configuring Git safe directories
26+
- Setting up global Git configuration
27+
- Installing dependencies that don't need to be in the image
28+
- ## Related
29+
- [[DevContainer/Ref/Variable/containerWorkspaceFolder]] - Variable commonly used with this key
30+
- [[DevContainer/Ref/Key]] - Index of all keys
31+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- # DevContainer Variables Reference
2+
- Variables that can be used in `devcontainer.json` configuration files
3+
- ## Variables
4+
- [[DevContainer/Ref/Variable/containerWorkspaceFolder]] - The absolute path of the workspace folder inside the container
5+
- *More variables will be added here as they are documented*
6+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- # Variable: ${containerWorkspaceFolder}
2+
- ## Description
3+
- The absolute path of the workspace folder inside the container
4+
- ## Usage
5+
- Used in `devcontainer.json` configuration files to reference the container's workspace path
6+
- Example: `"onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}"`
7+
- ## Context
8+
- This variable is particularly useful when configuring Git safe directories, as the container path may differ from the host path
9+
- ## Related
10+
- [[DevContainer/Ref/Key/onCreateCommand]] - Common key that uses this variable
11+
- [[DevContainer/Ref/Variable]] - Index of all variables
12+

0 commit comments

Comments
 (0)