It seems the terraform state for resource `envbuilder_cached_image` is never updated with the pushed image value: ``` ... #2: ENTRYPOINT ["/.envbuilder/bin/envbuilder"] #2: Taking snapshot of files... #2: Adding to layer: [] #2: Build: composite key for command ENTRYPOINT ["..."] #2: Build: cache key for command ENTRYPOINT ["/.envbuilder/bin/envbuilder"] 66d7bf66dcdcf27d528317b2f63e6a23baaaa705026030217a241023b0d998d0 #2: Layer already exists in image, using existing layer: sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef #2: Mapping stage idx 0 to digest sha256:b4c6bed29162866a0155bf9c966198b035451161df2722e7ab833f2d9e95b702 #2: Mapping digest sha256:b4c6bed29162866a0155bf9c966198b035451161df2722e7ab833f2d9e95b702 to cachekey 66d7bf66dcdcf27d528317b2f63e6a23baaaa705026030217a241023b0d998d0 #2: ๐Ÿ—๏ธ Built image! [1m12.642133031s] #3: ๐Ÿ—๏ธ Pushing image... #3: Pushing image to ghcr.io/xxx/yyy #3: Pushed ghcr.io/xxx/yyy@sha256:4c87e71c7d681d377b49b3b356c33abc292faac772e5abd97c9798107d088693 #3: ๐Ÿ‘€ Found devcontainer.json label metadata in image... Restored DOCKER_CONFIG to #4: ๐Ÿ”„ Updating ownership of /home/coder... #4: ๐Ÿก Updated ownership of /home/coder! [1.948646181s] === No onCreateCommand script specified === No updateContentCommand script specified === No postCreateCommand script specified === Running init command as user "coder": ["/bin/sh" "-c" "..."] โš™๏ธ Creating machine settings file... Installing code-server! ๐Ÿฅณ code-server has been installed in /tmp/code-server ๐Ÿ‘ท Running code-server in the background... Check logs at /tmp/code-server.log! ``` As the log states, push was successful (double-checked that the image SHA is available on GHCR side). However, while restarting the workspace, during the `Planning infrastructure` phase on Coder: ``` The previous state specifies image == builder_image "ghcr.io/coder/envbuilder:1.1.0", which indicates a previous cache miss. ``` Then at the `Starting workspace` phase on Coder: ``` Failed to find cached image in repository "ghcr.io/xxx/yyy". It will be rebuilt in the next apply. Error: get cached image: error probing build cache: uncached RUN command is not supported in cache probe mode Apply complete! Resources: 2 added, 1 changed, 1 destroyed. ``` However, probing via `envbuilder` CLI directly, seems to work as expected: ``` $ docker run --privileged -it --rm -v /workspaces:/workspaces -e ENVBUILDER_GIT_URL=https://github.com/xxx/yyy/#refs/coder -e ENVBUILDER_GIT_USERNAME=ghu_XoC4********** -e ENVBUILDER_CACHE_REPO=ghcr.io/xxx/yyy -e ENVBUILDER_PUSH_IMAGE=true -e ENVBUILDER_GET_CACHED_IMAGE=true -e ENVBUILDER_INIT_SCRIPT=bash -e ENVBUILDER_VERBOSE=true -e ENVBUILDER_DOCKER_CONFIG_BASE64="$(base64 -w0 /.envbuilder/config.json)" ghcr.io/coder/envbuilder envbuilder v1.1.0+a3a6a83 - Build development environments from repositories in a container Using base64 encoded Docker config Docker config contains auth for registry "ghcr.io" Set DOCKER_CONFIG to /.envbuilder/.docker Wrote Docker config JSON to /.envbuilder/.docker/config.json #1: ๐Ÿ“ฆ Cloning https://github.com/xxx/yyy/#refs/coder to /workspaces/yyy... #1: ๐Ÿ”’ Using HTTP basic authentication! #1: Parsed Git URL as "https://github.com/xxx/yyy/#refs/coder" #1: ๐Ÿ“ฆ The repository already exists! [222.523ยตs] copying envbuilder binary at "/.envbuilder/bin/envbuilder" to build context "/workspaces/yyy/.envbuilder.tmp/envbuilder" writing magic image file at "/workspaces/yyy/.envbuilder.tmp/image" in build context "/workspaces/yyy/.envbuilder.tmp" #2: ๐Ÿ—๏ธ Checking for cached image... #2: Resolved base name mcr.microsoft.com/devcontainers/typescript-node:20-bullseye to base #2: Built stage name to index map: map[base:0] #2: Using dockerignore file: /workspaces/yyy/.dockerignore #2: Retrieving image manifest mcr.microsoft.com/devcontainers/typescript-node:20-bullseye #2: Retrieving image mcr.microsoft.com/devcontainers/typescript-node:20-bullseye from registry mcr.microsoft.com #2: Built cross stage deps: map[] #2: Built image deps: map[] #2: Retrieving image manifest mcr.microsoft.com/devcontainers/typescript-node:20-bullseye #2: Returning cached image manifest #2: Executing 0 build triggers ..... #2: Taking snapshot of files... #2: Adding to layer: [] #2: Layer already exists in image, using existing layer: sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef #2: Mapping stage idx 0 to digest sha256:0c8dbb2b7c8f87515359681108f65f85843fee43d2c5ac6384f38f7eeb482cec #2: Mapping digest sha256:0c8dbb2b7c8f87515359681108f65f85843fee43d2c5ac6384f38f7eeb482cec to cachekey 66d7bf66dcdcf27d528317b2f63e6a23baaaa705026030217a241023b0d998d0 #2: ๐Ÿ—๏ธ Found cached image! [25.210830852s] Restored DOCKER_CONFIG to ENVBUILDER_CACHED_IMAGE=ghcr.io/xxx/yyy@sha256:21c79c334f2668393c23685cf3e39dfa5c2526b30ba7e6f8b23b81534171f1ad ```