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: add comprehensive dev containers documentation with examples#18582

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 merge25 commits intomain
base:main
Choose a base branch
Loading
fromdev-container-ga
Draft
Changes from1 commit
Commits
Show all changes
25 commits
Select commitHold shift + click to select a range
718e6f9
remove ea feature status
EdwardAngertJun 23, 2025
ba7a36c
add advanced dev container doc
EdwardAngertJun 24, 2025
ef8a4ea
update devcontainers
EdwardAngertJun 25, 2025
f4db3da
new workspace screenshot
EdwardAngertJun 25, 2025
df07196
consistent and working examples
EdwardAngertJun 26, 2025
18998b7
edits; prep advanced doc
EdwardAngertJun 26, 2025
ddc5893
Merge branch 'main' into dev-container-ga
EdwardAngertJun 26, 2025
048cf5b
advanced features
EdwardAngertJun 26, 2025
5dc41a5
better examples
EdwardAngertJun 26, 2025
be23e85
init user-facing update
EdwardAngertJun 26, 2025
ec77a25
remove coder_agent_devcontainers_enable requirement
EdwardAngertJun 27, 2025
06d714c
update features; add personal devcontainer file
EdwardAngertJun 27, 2025
8f392c0
update troubleshooting
EdwardAngertJun 27, 2025
2fe5291
add comparison doc; crosslink
EdwardAngertJun 27, 2025
33d3eed
shorten title
EdwardAngertJun 27, 2025
747822e
clarify envbuilder doc titles
EdwardAngertJun 27, 2025
d9f818c
update envbuilder doc with dev container integration consideration
EdwardAngertJun 27, 2025
c10eb7e
update envbuilder add-devcontainer with dev container integration links
EdwardAngertJun 27, 2025
3f8970e
envbuilder tweaks
EdwardAngertJun 27, 2025
0d0a9ba
link fix
EdwardAngertJun 27, 2025
88e7c0f
tweak to devcontainer.local note
EdwardAngertJun 27, 2025
8f5e613
ap title case
EdwardAngertJun 27, 2025
e83d564
leftover ea language
EdwardAngertJun 27, 2025
03c60bf
update ssh note and example
EdwardAngertJun 27, 2025
cfcef3c
update example template
EdwardAngertJun 27, 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
PrevPrevious commit
update example template
  • Loading branch information
@EdwardAngert
EdwardAngert committedJun 27, 2025
commitcfcef3c5e06be1ff55641f4e0ac67b6c0a169b51
66 changes: 46 additions & 20 deletionsdocs/admin/templates/extending-templates/devcontainers.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -167,53 +167,79 @@ You can test the Coder dev container integration and features with these starter

<details><summary>Docker-based template (privileged)</summary>

This version uses a Docker-in-Docker image, so it works even if the host doesn’t expose a Docker socket.

```terraform
terraform {
required_providers {
coder = { source = "coder/coder" }
docker = { source = "kreuzwerker/docker" }
coder = {
source = "coder/coder"
}
docker = {
source = "kreuzwerker/docker"
}
}
}

data "coder_workspace" "me" {}
data "coder_workspace_owner" "me" {}
provider "coder" {}

data "coder_workspace" "me" {}
data "coder_workspace_owner" "me" {}

resource "docker_container" "workspace" {
count = data.coder_workspace.me.start_count
image = "codercom/enterprise-base:ubuntu" # includes Coder agent
name = "coder-${data.coder_workspace_owner.me.name}-${lower(data.coder_workspace.me.name)}"

# share host Docker
volumes {
host_path = "/var/run/docker.sock"
container_path = "/var/run/docker.sock"
}

must_run = true # keep container alive

env = [
"CODER_AGENT_TOKEN=${coder_agent.main.token}",
"CODER_AGENT_URL=${data.coder_workspace.me.access_url}" # lets built-in entrypoint phone home
]
}

resource "coder_agent" "main" {
os = "linux"
arch = "amd64"

startup_script_behavior = "blocking"
startup_script = "sudo service docker start"
shutdown_script = "sudo service docker stop"
}

module "devcontainers_cli" {
# install node
module "nodejs" {
count = data.coder_workspace.me.start_count
source = "dev.registry.coder.com/modules/devcontainers-cli/coder"
source = "dev.registry.coder.com/modules/nodejs/coder"
agent_id = coder_agent.main.id
}

module "devcontainers_cli" {
count = data.coder_workspace.me.start_count
source = "dev.registry.coder.com/modules/devcontainers-cli/coder"
agent_id = coder_agent.main.id
depends_on = [module.nodejs] # npm first
}

# clone a repo
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 = "https://github.com/example/project.git"
base_dir= "/home/coder/project"
url = "https://github.com/devcontainers/template-starter.git"
base_dir = "/home/coder/project"
}

# launch the Dev Container
resource "coder_devcontainer" "project" {
count = data.coder_workspace.me.start_count
agent_id = coder_agent.main.id
workspace_folder = "/home/coder/project/${module.git_clone[0].folder_name}"
depends_on = [module.git_clone]
}

resource "docker_container" "workspace" {
count = data.coder_workspace.me.start_count
image = "codercom/enterprise-node:ubuntu"
name = "coder-${data.coder_workspace_owner.me.name}-${lower(data.coder_workspace.me.name)}"
privileged = true # or mount /var/run/docker.sock
}
```

</details>
Expand DownExpand Up@@ -249,7 +275,7 @@ 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 = "https://github.com/example/project.git"
url = "https://github.com/coder/coder.git"
base_dir = "/home/coder/project"
}

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp