Coder.comC
Coder.com8mo ago
9 replies
sharkymark

Envbuilder with Kubernetes: image cache not working

Layer caching appears to work fine. And I see both the image cache and layer caches in my DockerHub private registry (see screenshoot)

I'm just using the example template in Coder called kubernetes-devcontainer
https://github.com/coder/coder/blob/main/examples/templates/kubernetes-devcontainer/main.tf


However, when starting a workspace, I get this:

Warning: Cached image not found.
on main.tf line 203, in resource "envbuilder_cached_image" "cached":
  203: resource "envbuilder_cached_image" "cached" {
Failed to find cached image in repository "<removed>/kaniko-cache". It will be rebuilt in the next apply. Error: get cached image: error probing build cache: uncached COPY command is not supported in cache probe mode


And when I stop a workspace I get this:

Warning: Re-running cache probe due to previous miss.
on main.tf line 203, in resource "envbuilder_cached_image" "cached":
  203: resource "envbuilder_cached_image" "cached" {
The previous state specifies image == builder_image "ghcr.io/coder/envbuilder:latest", which indicates a previous cache miss.


I did ENVBUILDER_GET_CACHED_IMAGE=1 and the workspace logs says it sees the matched image in the registry, but the build goes into an endless loop which I get since the probe should be occurring in the build, and not with a manual set of the env var.

Thanks team
image.png
GitHub
Provision remote development environments via Terraform - coder/coder
coder/examples/templates/kubernetes-devcontainer/main.tf at main ·...
Was this page helpful?