You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/admin/templates/extending-templates/advanced-dev-containers.md
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,22 @@ module "git-clone-backend" {
56
56
57
57
Each dev container will appear as a separate agent in the Coder UI, allowing developers to connect to different environments within the same workspace.
58
58
59
+
##Add a Personal devcontainer.json alongside a repository-specific one
60
+
61
+
Keep a canonical`devcontainer.json` in the repo, then let each developer add an
62
+
untracked`devcontainer.local.json` (or another file referenced via`"extends"`).
Coder's dev container support allows developers to work in fully configured environments with their preferred tools and extensions.
6
+
7
+
To enable dev containers in workspaces,[configure your template](../creating-templates.md) with the dev containers
4
8
modules and configurations outlined in this doc.
5
9
10
+
##Why use dev containers
11
+
12
+
Dev containers improve consistency across environments by letting developers define their development setup.
13
+
When integrated with Coder templates, they provide:
14
+
15
+
-**Project-specific environments**: Each repository can define its own tools, extensions, and configuration.
16
+
-**Zero setup time**: Developers get fully configured environments without manual installation.
17
+
-**Consistency across teams**: Everyone works in identical environments regardless of their local machine.
18
+
-**Version control**: Development environment changes are tracked alongside code changes.
19
+
20
+
##Prerequisites
21
+
22
+
Dev containers require Docker to build and run containers.
23
+
Ensure your workspace infrastructure has Docker configured with container creation permissions and sufficient resources.
24
+
25
+
To confirm that Docker is configured correctly, create a test workspace and confirm that`docker ps` runs.
26
+
If it doesn't, follow the steps in[Docker in workspaces](./docker-in-workspaces.md).
27
+
28
+
##Enable Dev Containers Integration
29
+
30
+
To enable the dev containers integration in your workspace, add the`CODER_AGENT_DEVCONTAINERS_ENABLE` environment variable to your existing`coder_agent` block:
31
+
32
+
```terraform
33
+
env = {
34
+
CODER_AGENT_DEVCONTAINERS_ENABLE = "true"
35
+
# existing variables ...
36
+
}
37
+
```
38
+
39
+
This environment variable is required for the Coder agent to detect and manage dev containers.
40
+
Without it, the agent will not attempt to start or connect to dev containers even if the