Zoker
Zoker
CCoder.com
Created by Zoker on 2/5/2025 in #help
How to use coder_parameter to force_rebuild docker images?
Hi there, I saw this in the docs:
data "coder_parameter" "force_rebuild" {
name = "force_rebuild"
type = "bool"
description = "Rebuild the Docker image rather than use the cached one."
mutable = true
default = false
ephemeral = true
}
data "coder_parameter" "force_rebuild" {
name = "force_rebuild"
type = "bool"
description = "Rebuild the Docker image rather than use the cached one."
mutable = true
default = false
ephemeral = true
}
(source: https://coder.com/docs/@v2.19.0/admin/templates/extending-templates/parameters#ephemeral-parameters) How I want to add this feature to my current template. I guess I need to use the force_rebuild somewhere in order to really force the rebuild of the image, right? Probably in the triggers here:
resource "docker_image" "main" {
name = "coder-${data.coder_workspace.me.id}"
build {
context = "."
build_args = {
USER = local.username
}
}
triggers = {
docker_sha1 = sha1(filesha1("./Dockerfile"))
terraform_sha1 = sha1(filesha1("./Base.tf"))
rebuild_sha1 = sha1(data.coder_parameter.force_rebuild.value) <-- something like this?
assets_sha1 = sha1(join("", [for f in fileset(path.module, "./assets/*") : filesha1(f)]))
}
}
resource "docker_image" "main" {
name = "coder-${data.coder_workspace.me.id}"
build {
context = "."
build_args = {
USER = local.username
}
}
triggers = {
docker_sha1 = sha1(filesha1("./Dockerfile"))
terraform_sha1 = sha1(filesha1("./Base.tf"))
rebuild_sha1 = sha1(data.coder_parameter.force_rebuild.value) <-- something like this?
assets_sha1 = sha1(join("", [for f in fileset(path.module, "./assets/*") : filesha1(f)]))
}
}
Would this work? Thanks!
18 replies
CCoder.com
Created by Zoker on 4/22/2024 in #help
Error when updating code-server to 4.23.1 within coder
I upgraded code-server from 4.23.0 to 4.23.1 within my coder.com instance (using this module: https://registry.coder.com/modules/code-server). When I now start my workspaces, I get this error:
gzip: stdin: invalid compressed data--crc error
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Failed to install code-server: Ubuntu 23.10
Installing v4.23.1 of the amd64 release from GitHub.
+ Reusing ~/.cache/code-server/code-server-4.23.1-linux-amd64.tar.gz
+ mkdir -p /tmp/code-server
+ mkdir -p /tmp/code-server/lib /tmp/code-server/bin
+ tar -C /tmp/code-server/lib -xzf ~/.cache/code-server/code-server-4.23.1-linux-amd64.tar.gz
gzip: stdin: invalid compressed data--crc error
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Failed to install code-server: Ubuntu 23.10
Installing v4.23.1 of the amd64 release from GitHub.
+ Reusing ~/.cache/code-server/code-server-4.23.1-linux-amd64.tar.gz
+ mkdir -p /tmp/code-server
+ mkdir -p /tmp/code-server/lib /tmp/code-server/bin
+ tar -C /tmp/code-server/lib -xzf ~/.cache/code-server/code-server-4.23.1-linux-amd64.tar.gz
When I downgrade again to 4.23.0 everything works fine.
2 replies
CCoder.com
Created by Zoker on 3/6/2024 in #help
What is the best way to keep installed system packages?
I use ubuntu as my base docker image. In a lot of workspaces I install additional system packages via apt. When I use codespaces and install packages there, they stay on even after a restart. What is the best way to keep them? One way would be to use the personalized file right? Any other/better way without user interference?
7 replies
CCoder.com
Created by Zoker on 2/27/2024 in #help
Is the external auth gone?
No description
55 replies