Skip to content

Commit eacb146

Browse files
committed
docs: improve dev containers accuracy and clarity
- Add third devcontainer.json location for monorepos, link to spec - Clarify hostname suffix is a deployment setting - Tighten project discovery section, clarify autostart behavior
1 parent 84572dc commit eacb146

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

docs/admin/templates/extending-templates/devcontainers.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ This is the recommended approach for most use cases.
2525

2626
### Project Discovery
2727

28-
Enable automatic discovery of Dev Containers in Git repositories. Project discovery automatically scans Git repositories for `.devcontainer/devcontainer.json` or `.devcontainer.json` files and surfaces them in the Coder UI. See the [Environment Variables](#environment-variables) section for detailed configuration options.
28+
Alternatively, enable automatic discovery of Dev Containers in Git repositories.
29+
The agent scans for `devcontainer.json` files and surfaces them in the Coder UI.
30+
See [Environment Variables](#environment-variables) for configuration options.
2931

3032
## Install the Dev Containers CLI
3133

@@ -123,11 +125,10 @@ When enabled, the agent will:
123125

124126
- Scan the agent directory for Git repositories
125127
- Look for `.devcontainer/devcontainer.json` or `.devcontainer.json` files
126-
- Surface discovered Dev Containers automatically in the Coder UI
128+
- Surface discovered Dev Containers in the Coder UI
127129
- Respect `.gitignore` patterns during discovery
128130

129-
You can disable automatic discovery by setting this to `false` if you prefer to
130-
use only the `coder_devcontainer` resource for explicit configuration.
131+
Set to `false` if you prefer explicit configuration via `coder_devcontainer`.
131132

132133
### CODER_AGENT_DEVCONTAINERS_DISCOVERY_AUTOSTART_ENABLE
133134

@@ -194,9 +195,10 @@ resource "coder_devcontainer" "my-repository" {
194195
}
195196
```
196197

197-
### Alternative: Project Discovery Mode
198+
### Alternative: Project Discovery with Autostart
198199

199-
You can enable automatic starting of discovered Dev Containers:
200+
By default, discovered containers appear in the dashboard but developers must
201+
manually start them. To have them start automatically, enable autostart:
200202

201203
```terraform
202204
resource "docker_container" "workspace" {
@@ -212,11 +214,11 @@ resource "docker_container" "workspace" {
212214
}
213215
```
214216

215-
With this configuration:
217+
With autostart enabled:
216218

217-
- Project discovery is enabled (default behavior)
218-
- Discovered containers are automatically started (via the env var)
219-
- The `coder_devcontainer` resource is **not** required
219+
- Discovered containers automatically build and start during workspace
220+
initialization
221+
- The `coder_devcontainer` resource is not required
220222
- Developers can work with multiple projects seamlessly
221223

222224
> [!NOTE]

docs/user-guides/devcontainers/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ development environment. You can place it in:
3737

3838
- `.devcontainer/devcontainer.json` (recommended)
3939
- `.devcontainer.json` (root of repository)
40+
- `.devcontainer/<folder>/devcontainer.json` (for multiple configurations)
41+
42+
The third option allows monorepos to define multiple dev container
43+
configurations in separate sub-folders. See the
44+
[Dev Container specification](https://containers.dev/implementors/spec/#devcontainerjson)
45+
for details.
4046

4147
Here's a minimal example:
4248

docs/user-guides/devcontainers/working-with-dev-containers.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ For example:
5757
ssh my-project.my-workspace.alice.coder
5858
```
5959

60-
The hostname suffix defaults to `coder` but can be customized via
61-
`CODER_WORKSPACE_HOSTNAME_SUFFIX`.
60+
The hostname suffix defaults to `coder` but can be customized by your
61+
deployment administrator via the
62+
[`--workspace-hostname-suffix`](../../reference/cli/server.md#--workspace-hostname-suffix)
63+
server option.
6264

6365
This method works with any SSH client, IDE remote extensions, `rsync`, `scp`,
6466
and other tools that use SSH.

0 commit comments

Comments
 (0)