add: code-server to template examples (#3739)

* add: code-server to template examples

* add: code-server to gcp templates

* add: code-server to gcp-linux template

* update: READMEs

* update: boot disk version

* update: google provider version
This commit is contained in:
Eric Paulsen
2022-08-30 10:55:40 -05:00
committed by GitHub
parent 20086c1e77
commit 8a60ee0391
9 changed files with 93 additions and 3 deletions
+6
View File
@@ -68,3 +68,9 @@ instances provisioned by Coder:
]
}
```
## code-server
`code-server` is installed via the `startup_script` argument in the `coder_agent`
resource block. The `coder_app` resource is defined to access `code-server` through
the dashboard UI over `localhost:13337`.
+14
View File
@@ -76,6 +76,20 @@ resource "coder_agent" "main" {
arch = "amd64"
auth = "aws-instance-identity"
os = "linux"
startup_script = <<EOT
#!/bin/bash
# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
code-server --auth none --port 13337 | tee code-server-install.log &
EOT
}
resource "coder_app" "code-server" {
agent_id = coder_agent.main.id
name = "code-server"
url = "http://localhost:13337/?folder=/home/coder"
icon = "/icon/code.svg"
}
locals {
@@ -146,6 +146,12 @@ coder ls
coder update [workspace name]
```
## code-server
`code-server` is installed via the `startup_script` argument in the `coder_agent`
resource block. The `coder_app` resource is defined to access `code-server` through
the dashboard UI over `localhost:13337`.
## Extending this template
See the [kreuzwerker/docker](https://registry.terraform.io/providers/kreuzwerker/docker) Terraform provider documentation to
@@ -24,6 +24,20 @@ data "coder_workspace" "me" {
resource "coder_agent" "main" {
arch = data.coder_provisioner.me.arch
os = "linux"
startup_script = <<EOT
#!/bin/bash
# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
code-server --auth none --port 13337 | tee code-server-install.log &
EOT
}
resource "coder_app" "code-server" {
agent_id = coder_agent.main.id
name = "code-server"
url = "http://localhost:13337/?folder=/home/coder"
icon = "/icon/code.svg"
}
variable "docker_image" {
+6
View File
@@ -43,6 +43,12 @@ coder template push docker
You can also remove images from the validation list. Workspaces using older template versions will continue using
the removed image until you update the workspace to the latest version.
## code-server
`code-server` is installed via the `startup_script` argument in the `coder_agent`
resource block. The `coder_app` resource is defined to access `code-server` through
the dashboard UI over `localhost:13337`.
## Updating images
To reduce drift, we recommend versioning images in your registry by creating tags. To update the image tag in the template:
+6
View File
@@ -43,3 +43,9 @@ a service account:
1. Generate a **JSON private key**, which will be what you provide to Coder
during the setup process.
## code-server
`code-server` is installed via the `startup_script` argument in the `coder_agent`
resource block. The `coder_app` resource is defined to access `code-server` through
the dashboard UI over `localhost:13337`.
+19 -3
View File
@@ -46,9 +46,25 @@ resource "google_compute_disk" "root" {
}
resource "coder_agent" "main" {
auth = "google-instance-identity"
arch = "amd64"
os = "linux"
auth = "google-instance-identity"
arch = "amd64"
os = "linux"
startup_script = <<EOT
#!/bin/bash
# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
code-server --auth none --port 13337 | tee code-server-install.log &
EOT
}
# code-server
resource "coder_app" "code-server" {
agent_id = coder_agent.main.id
name = "code-server"
icon = "/icon/code.svg"
url = "http://localhost:13337?folder=/home/coder"
relative_path = true
}
resource "google_compute_instance" "dev" {
@@ -43,3 +43,9 @@ a service account:
1. Generate a **JSON private key**, which will be what you provide to Coder
during the setup process.
## code-server
`code-server` is installed via the `startup_script` argument in the `coder_agent`
resource block. The `coder_app` resource is defined to access `code-server` through
the dashboard UI over `localhost:13337`.
@@ -39,6 +39,22 @@ resource "coder_agent" "main" {
auth = "google-instance-identity"
arch = "amd64"
os = "linux"
startup_script = <<EOT
#!/bin/bash
# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
code-server --auth none --port 13337 | tee code-server-install.log &
EOT
}
# code-server
resource "coder_app" "code-server" {
agent_id = coder_agent.main.id
name = "code-server"
icon = "/icon/code.svg"
url = "http://localhost:13337?folder=/home/coder"
relative_path = true
}
module "gce-container" {