diff --git a/docs/ides.md b/docs/ides.md index a8d038c06b623..d3a2a63ecfcef 100644 --- a/docs/ides.md +++ b/docs/ides.md @@ -57,20 +57,65 @@ Code, connected to your Coder workspace for compute, etc. 1. In VS Code's left-hand nav bar, click **Remote Explorer** and right-click on a workspace to connect. -## VS Code in the browser +## VS Code in the browser (code-server) -> You must have Docker Desktop running for this template to work. +There a few ways to add `code-server` to a workspace. You can install it in the Dockerfile and subsequent container image or VM image, or install it dynamically as part of coder_agent resource in a template. -Coder offers a [sample template that includes -code-server](../examples/templates/docker-code-server/README.md). +You start `code-server` in the `coder_agent` resource of a template, and add a `coder_app` resource to define the icon and url for code-server to appear in the workspace web UI. -To use: +

+ +

-1. Start Coder: +Here is an example of installing `code-server` in a Dockerfile - ```console - coder server --dev - ``` +```console +FROM codercom/enterprise-base:ubuntu + +USER root + +# Install code-server +RUN curl -fsSL https://code-server.dev/install.sh | sh + +USER coder +``` + +Here is an example of installing `code-server` in the `coder_agent` resource of a template's `main.tf` and defining the `coder_app` resource. If you install `code-server` in the image, you can eliminate the install step below. + +```console +resource "coder_agent" "coder" { + os = "linux" + arch = "amd64" + startup_script = < You must have Docker Desktop or a Docker engine running for this template to work. + +Coder offers a [sample template that includes +code-server](../examples/templates/docker-code-server/README.md). + +To use, start Coder the follow these steps: 1. Open a new terminal and run: diff --git a/docs/images/code-server-in-ui.png b/docs/images/code-server-in-ui.png new file mode 100644 index 0000000000000..0851112bfdfe6 Binary files /dev/null and b/docs/images/code-server-in-ui.png differ