@@ -4,16 +4,11 @@ The dev containers integration enables seamless creation and management of dev c
4
4
This feature leverages the [ ` @devcontainers/cli ` ] ( https://github.com/devcontainers/cli ) and [ Docker] ( https://www.docker.com )
5
5
to provide a streamlined development experience.
6
6
7
- This implementation is different from the existing
8
- [ Envbuilder-based dev containers] ( ../../admin/templates/managing-templates/devcontainers/index.md )
9
- offering.
10
-
11
7
## Prerequisites
12
8
13
- - Coder version 2.22 .0 or later
14
- - Coder CLI version 2.22 .0 or later
9
+ - Coder version 2.24 .0 or later
10
+ - Coder CLI version 2.24 .0 or later
15
11
- A template with:
16
- - Dev containers integration enabled
17
12
- A Docker-compatible workspace image
18
13
- Appropriate permissions to execute Docker commands inside your workspace
19
14
@@ -30,50 +25,63 @@ which allows for extensive customization of your development setup.
30
25
When a workspace with the dev containers integration starts:
31
26
32
27
1 . The workspace initializes the Docker environment.
33
- 1 . The integration detects repositories with a ` .devcontainer ` directory or a
34
- ` devcontainer.json ` file.
35
- 1 . The integration builds and starts the dev container based on the
36
- configuration.
28
+ 1 . The integration detects repositories with a ` .devcontainer ` directory or a ` devcontainer.json ` file.
29
+ 1 . The integration builds (or rebuilds) and starts the dev container based on the configuration.
37
30
1 . Your workspace automatically detects the running dev container.
31
+ 1 . If the configuration changes, the workspace prompts you to rebuild the dev container.
38
32
39
33
## Features
40
34
41
- ### Available Now
35
+ ### Detection & Lifecycle
36
+
37
+ - Automatic discovery of ` .devcontainer ` configs.
38
+ - Change detection with rebuild prompts.
39
+ - Rebuild containers with one click from the Coder dashboard or from the CLI.
40
+
41
+ ### Connectivity
42
+
43
+ - Full SSH access directly into dev containers (` coder ssh --container ... ` ).
44
+ - Automatic port forwarding based on ` appPort ` , ` forwardPorts ` , or ` docker-compose.yml ` .
42
45
43
- - Automatic dev container detection from repositories
44
- - Seamless dev container startup during workspace initialization
45
- - Integrated IDE experience in dev containers with VS Code
46
- - Direct service access in dev containers
47
- - Limited SSH access to dev containers
46
+ ## Personal overrides
48
47
49
- ### Coming Soon
48
+ To add tools or tweaks that enhance your personal experience, create a ` devcontainer.local.json ` file in the same
49
+ directory as the project’s ` devcontainer.json ` :
50
50
51
- - Dev container change detection
52
- - On-demand dev container recreation
53
- - Support for automatic port forwarding inside the container
54
- - Full native SSH support to dev containers
51
+ ``` jsonc
52
+ {
53
+ " extends" : " ./devcontainer.json" ,
54
+ " features" : {
55
+ " ghcr.io/devcontainers/features/node" : { " version" : " 20" }
56
+ },
57
+ " postStartCommand" : " npm i -g tldr"
58
+ }
59
+ ```
60
+
61
+ Add the file name to your project's ` .gitignore ` or to your
62
+ [ global exclude file] ( https://docs.github.com/en/get-started/git-basics/ignoring-files#configuring-ignored-files-for-all-repositories-on-your-computer ) .
55
63
56
64
## Comparison with Envbuilder-based Dev Containers
57
65
58
- | Feature | Dev Containers (Early Access) | Envbuilder Dev Containers |
66
+ | Feature | Dev Containers | Envbuilder Dev Containers |
59
67
| ----------------| ----------------------------------------| ----------------------------------------------|
60
68
| Implementation | Direct ` @devcontainers/cli ` and Docker | Coder's Envbuilder |
61
69
| Target users | Individual developers | Platform teams and administrators |
62
70
| Configuration | Standard ` devcontainer.json ` | Terraform templates with Envbuilder |
63
71
| Management | User-controlled | Admin-controlled |
64
72
| Requirements | Docker access in workspace | Compatible with more restricted environments |
65
73
66
- Choose the appropriate solution based on your team's needs and infrastructure
67
- constraints. For additional details on Envbuilder's dev container support, see
68
- the
74
+ Choose the appropriate solution based on your team's needs and infrastructure constraints.
75
+ For additional details on Envbuilder's dev container support, see the
69
76
[ Envbuilder devcontainer spec support documentation] ( https://github.com/coder/envbuilder/blob/main/docs/devcontainer-spec-support.md ) .
70
77
78
+ ## Known Limitations
79
+
80
+ Currently, dev containers are not compatible with the [ prebuilt workspaces] ( ../../admin/templates/extending-templates/prebuilt-workspaces.md ) .
81
+
82
+ If your template allows for prebuilt workspaces, do not select a prebuilt workspace if you plan to use a dev container.
83
+
71
84
## Next Steps
72
85
73
- - Explore the [ dev container specification] ( https://containers.dev/ ) to learn
74
- more about advanced configuration options
75
- - Read about [ dev container features] ( https://containers.dev/features ) to
76
- enhance your development environment
77
- - Check the
78
- [ VS Code dev containers documentation] ( https://code.visualstudio.com/docs/devcontainers/containers )
79
- for IDE-specific features
86
+ - [ Dev container specification] ( https://containers.dev/ )
87
+ - [ VS Code dev containers documentation] ( https://code.visualstudio.com/docs/devcontainers/containers )
0 commit comments