Skip to content

Commit

Permalink
chore: add info re: always updating images (#2635)
Browse files Browse the repository at this point in the history
  • Loading branch information
Katie Horne committed Jun 28, 2022
1 parent 37f9dff commit 09cb778
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion docs/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,28 @@ resource "docker_container" "workspace" {
}
```

#### Using updated images when rebuilding a workspace

To ensure that Coder uses an updated image when rebuilding a workspace, we
suggest that admins update the tag in the template (e.g., `my-image:v0.4.2` ->
`my-image:v0.4.3`) or digest (`my-image@sha256:[digest]` ->
`my-image@sha256:[new_digest]`).

Alternatively, if you're willing to wait for longer start times from Coder, you
can set the `imagePullPolicy` to `Always` in your Terraform template; when set,
Coder will check `image:tag` on every build and update if necessary:

```tf
resource "kubernetes_pod" "podName" {
spec {
container {
image_pull_policy = "Always"
}
}
}
```


#### Delete workspaces

When a workspace is deleted, the Coder server essentially runs a
Expand All @@ -172,7 +194,7 @@ resources associated with the workspace.
> [prevent-destroy](https://www.terraform.io/language/meta-arguments/lifecycle#prevent_destroy)
> and
> [ignore-changes](https://www.terraform.io/language/meta-arguments/lifecycle#ignore_changes)
> meta-arguments can be used to accidental data loss.
> meta-arguments can be used to accidental data loss.
### Coder apps

Expand Down

0 comments on commit 09cb778

Please sign in to comment.