Skip to content

Agent: allow automatically starting a devcontainer defined in template #16423

@johnstcn

Description

@johnstcn

Allow a template author to define a devcontainer as part of a coder_agent resource (or even as part of a separate coder_agent_devcontainer resource):

resource "coder_agent" "main" {
  [...]
  devcontainer {
    workspace_folder = "$${HOME}/src/devcontainer_repo" # Required
    config = ".devcontainer/devcontainer.json" # optional, default
    # additional options TBD
  }
}

Expose agent API endpoints to start and stop the devcontainer using @devcontainers/cli e.g. the agent will simply run

cd $DEVCONTAINER_DIR && devcontainer up --workspace-folder .

Wire these up to coderd endpoints to trigger the start and stop.

For now, only support Docker via @devcontainers/cli.

This will require supporting work from the Terraform provider.

TODO: should this part of the coder_agent schema, or a separate data source entirely?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions