Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs: update dev container docs for GA#18907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
EdwardAngert wants to merge16 commits intomain
base:main
Choose a base branch
Loading
from18582-dev-containers
Draft
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
16 commits
Select commitHold shift + click to select a range
fb92c9f
update devcontainers for ga
EdwardAngertJul 15, 2025
5a4ca2f
edit devcontainers doc
EdwardAngertJul 16, 2025
d978111
add advanced dev containers
EdwardAngertJul 16, 2025
736202d
add dev-container-envbuilder comparison
EdwardAngertJul 16, 2025
09effa1
edit add-devcontainer
EdwardAngertJul 16, 2025
0b4ac18
edit dev-container-known-issues
EdwardAngertJul 16, 2025
bff7a37
edit envbuilder docs
EdwardAngertJul 16, 2025
dde4010
update workspace screenshot
EdwardAngertJul 16, 2025
02b110f
update workspace screenshot
EdwardAngertJul 16, 2025
0f47c56
update manifest
EdwardAngertJul 16, 2025
0e8383e
update user-guide
EdwardAngertJul 16, 2025
4116768
troubleshooting-dev-containers
EdwardAngertJul 16, 2025
6a6a49e
init working-with-dev-containers edit
EdwardAngertJul 16, 2025
7a4719d
dev container casing
EdwardAngertJul 17, 2025
f88ecb8
link fix
EdwardAngertJul 17, 2025
5085d78
s/coder ssh/ssh
EdwardAngertJul 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletionsdocs/about/contributing/backend.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -49,7 +49,7 @@ Coder's backend is built using a collection of robust, modern Go libraries and i

The Coder backend is organized into multiple packages and directories, each with a specific purpose. Here's a high-level overview of the most important ones:

* [agent](https://github.com/coder/coder/tree/main/agent): core logic of a workspace agent, supportsDevContainers, remote SSH, startup/shutdown script execution. Protobuf definitions for DRPC communication with `coderd` are kept in [proto](https://github.com/coder/coder/tree/main/agent/proto).
* [agent](https://github.com/coder/coder/tree/main/agent): core logic of a workspace agent, supportsdev containers, remote SSH, startup/shutdown script execution. Protobuf definitions for DRPC communication with `coderd` are kept in [proto](https://github.com/coder/coder/tree/main/agent/proto).
* [cli](https://github.com/coder/coder/tree/main/cli): CLI interface for `coder` command built on [coder/serpent](https://github.com/coder/serpent). Input controls are defined in [cliui](https://github.com/coder/coder/tree/docs-backend-contrib-guide/cli/cliui), and [testdata](https://github.com/coder/coder/tree/docs-backend-contrib-guide/cli/testdata) contains golden files for common CLI calls

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

🚫[linkspector]reported byreviewdog 🐶
Cannot reachhttps://github.com/coder/coder/tree/docs-backend-contrib-guide/cli/cliui Status: 404

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

🚫[linkspector]reported byreviewdog 🐶
Cannot reachhttps://github.com/coder/coder/tree/docs-backend-contrib-guide/cli/testdata Status: 404

* [cmd](https://github.com/coder/coder/tree/main/cmd): entry points for CLI and services, including `coderd`
* [coderd](https://github.com/coder/coder/tree/main/coderd): the main API server implementation with [chi](https://github.com/go-chi/chi) endpoints
Expand All@@ -72,7 +72,7 @@ The Coder backend is organized into multiple packages and directories, each with
* [dbpurge](https://github.com/coder/coder/tree/main/coderd/database/dbpurge): simple wrapper for periodic database cleanup operations
* [migrations](https://github.com/coder/coder/tree/main/coderd/database/migrations): an ordered list of up/down database migrations, use `./create_migration.sh my_migration_name` to modify the database schema
* [pubsub](https://github.com/coder/coder/tree/main/coderd/database/pubsub): PubSub implementation using PostgreSQL and in-memory drop-in replacement
* [queries](https://github.com/coder/coder/tree/main/coderd/database/queries): contains SQL files with queries, `sqlc` compiles them to [Go functions](https://github.com/coder/coder/blob/docs-backend-contrib-guide/coderd/database/queries.sql.go)
* [queries](https://github.com/coder/coder/tree/main/coderd/database/queries): contains SQL files with queries, `sqlc` compiles them to [Go functions](https://github.com/coder/coder/tree/main/coderd/database/queries.sql.go)
* [sqlc.yaml](https://github.com/coder/coder/tree/main/coderd/database/sqlc.yaml): defines mappings between SQL types and custom Go structures
* [codersdk](https://github.com/coder/coder/tree/main/codersdk): user-facing API entities used by CLI and site to communicate with `coderd` endpoints
* [dogfood](https://github.com/coder/coder/tree/main/dogfood): Terraform definition of the dogfood cluster deployment
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
# Advanced Dev Container Configuration

This page extends the [dev containers documentation](./devcontainers.md) with patterns for multiple dev containers,
user-controlled startup, repository selection, and infrastructure tuning.

## Run Multiple Dev Containers

Run independent dev containers in the same workspace so each component appears as its own agent.

In this example, there are two: repositories called `frontend` and `backend`:

```terraform
# Clone each repo
module "git-clone-frontend" {
count = data.coder_workspace.me.start_count
source = "dev.registry.coder.com/modules/git-clone/coder"

agent_id = coder_agent.main.id
url = "https://github.com/your-org/frontend.git"
}

module "git-clone-backend" {
count = data.coder_workspace.me.start_count
source = "dev.registry.coder.com/modules/git-clone/coder"

agent_id = coder_agent.main.id
url = "https://github.com/your-org/backend.git"
}

# Dev container resources
resource "coder_devcontainer" "frontend" {
count = data.coder_workspace.me.start_count
agent_id = coder_agent.main.id
workspace_folder = module.git-clone-frontend[0].repo_dir
}

resource "coder_devcontainer" "backend" {
count = data.coder_workspace.me.start_count
agent_id = coder_agent.main.id
workspace_folder = module.git-clone-backend[0].repo_dir
}
```

Each dev container appears as a separate agent, so developers can connect to each separately.

## Conditional Startup

Use `coder_parameter` booleans to let workspace creators choose which dev containers start automatically,
reducing resource usage for unneeded components:

```terraform
data "coder_parameter" "autostart_frontend" {
type = "bool"
name = "Autostart frontend container"
default = true
mutable = true
order = 3
}

resource "coder_devcontainer" "frontend" {
count = data.coder_parameter.autostart_frontend.value ? data.coder_workspace.me.start_count : 0
agent_id = coder_agent.main.id
workspace_folder = module.git-clone-frontend[0].repo_dir
}
```

## Repository-selection Patterns

Prompt users to pick a repository or team at workspace creation time and clone the selected repo(s) automatically into the workspace:

1. Add a parameter to the template:

```terraform
data "coder_parameter" "project" {
name = "project"
display_name = "Choose a project"
type = "string"
default = "https://github.com/coder/coder.git"

option {
name = "coder/coder"
value = "https://github.com/coder/coder.git"
}
option {
name = "terraform-provider-coder"
value = "https://github.com/coder/terraform-provider-coder.git"
}
}
```

1. Change the `git-clone` module to accept the `value` as the `url`:

```terraform
module "git-clone" {
count = data.coder_workspace.me.start_count
source = "dev.registry.coder.com/modules/git-clone/coder"
agent_id = coder_agent.main.id
url = data.coder_parameter.project.value
}
```
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
# Choose an Approach To Dev Containers

Coder supports two independent ways to run Dev Containers inside a workspace.

Both implement the [Dev Container specification](https://containers.dev/), but they differ in how the container is built,
who controls it, and which runtime requirements exist.

Use this page to decide which path fits your project or platform needs.

## Options at a Glance

| Capability / Trait | Dev Containers integration | Envbuilder |
|------------------------------------------|--------------------------------------------|-------------------------------------------|
| How it's built | `@devcontainers/cli` and Docker | Envbuilder transforms the workspace image |
| Docker-in-Docker? | Yes (parent workspace and child container) | No (modifies the parent container) |
| Multiple dev containers per workspace | Yes | No |
| Rebuild when `devcontainer.json` changes | Yes - user-initiated | Requires full workspace restart |

## Related Reading

- [Dev Containers integration](./devcontainers.md)
- [Dev Containers specification](https://containers.dev/)
- [Envbuilder on GitHub](https://github.com/coder/envbuilder)
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp