File tree 5 files changed +46
-0
lines changed 5 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -68,3 +68,9 @@ instances provisioned by Coder:
68
68
]
69
69
}
70
70
```
71
+
72
+ ## code-server
73
+
74
+ ` code-server ` is installed via the ` startup_script ` argument in the ` coder_agent `
75
+ resource block. The ` coder_app ` resource is defined to access ` code-server ` through
76
+ the dashboard UI over ` localhost:13337 ` .
Original file line number Diff line number Diff line change @@ -76,6 +76,20 @@ resource "coder_agent" "main" {
76
76
arch = " amd64"
77
77
auth = " aws-instance-identity"
78
78
os = " linux"
79
+ startup_script = << EOT
80
+ #!/bin/bash
81
+
82
+ # install and start code-server
83
+ curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
84
+ code-server --auth none --port 13337 | tee code-server-install.log &
85
+ EOT
86
+ }
87
+
88
+ resource "coder_app" "code-server" {
89
+ agent_id = coder_agent. main . id
90
+ name = " code-server"
91
+ url = " http://localhost:13337/?folder=/home/coder"
92
+ icon = " /icon/code.svg"
79
93
}
80
94
81
95
locals {
Original file line number Diff line number Diff line change @@ -146,6 +146,12 @@ coder ls
146
146
coder update [workspace name]
147
147
```
148
148
149
+ ## code-server
150
+
151
+ ` code-server ` is installed via the ` startup_script ` argument in the ` coder_agent `
152
+ resource block. The ` coder_app ` resource is defined to access ` code-server ` through
153
+ the dashboard UI over ` localhost:13337 ` .
154
+
149
155
## Extending this template
150
156
151
157
See the [ kreuzwerker/docker] ( https://registry.terraform.io/providers/kreuzwerker/docker ) Terraform provider documentation to
Original file line number Diff line number Diff line change @@ -24,6 +24,20 @@ data "coder_workspace" "me" {
24
24
resource "coder_agent" "main" {
25
25
arch = data. coder_provisioner . me . arch
26
26
os = " linux"
27
+ startup_script = << EOT
28
+ #!/bin/bash
29
+
30
+ # install and start code-server
31
+ curl -fsSL https://code-server.dev/install.sh | sh | tee code-server-install.log
32
+ code-server --auth none --port 13337 | tee code-server-install.log &
33
+ EOT
34
+ }
35
+
36
+ resource "coder_app" "code-server" {
37
+ agent_id = coder_agent. main . id
38
+ name = " code-server"
39
+ url = " http://localhost:13337/?folder=/home/coder"
40
+ icon = " /icon/code.svg"
27
41
}
28
42
29
43
variable "docker_image" {
Original file line number Diff line number Diff line change @@ -43,6 +43,12 @@ coder template push docker
43
43
You can also remove images from the validation list. Workspaces using older template versions will continue using
44
44
the removed image until you update the workspace to the latest version.
45
45
46
+ ## code-server
47
+
48
+ ` code-server ` is installed via the ` startup_script ` argument in the ` coder_agent `
49
+ resource block. The ` coder_app ` resource is defined to access ` code-server ` through
50
+ the dashboard UI over ` localhost:13337 ` .
51
+
46
52
## Updating images
47
53
48
54
To reduce drift, we recommend versioning images in your registry by creating tags. To update the image tag in the template:
You can’t perform that action at this time.
0 commit comments