File tree 1 file changed +4
-1
lines changed
examples/templates/gcp-devcontainer
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,9 @@ locals {
172
172
# The startup script will write this to a file, which the Docker run command will reference.
173
173
docker_env_list_base64 = base64encode (join (" \n " , [for k , v in local . docker_env_input : " ${ k } =${ v } " ]))
174
174
175
+ # Builder image will either be the builder image parameter, or the cached image, if cache is provided.
176
+ builder_image = try (envbuilder_cached_image. cached [0 ]. image , data. coder_parameter . devcontainer_builder . value )
177
+
175
178
# The GCP VM needs a startup script to set up the environment and start the container. Defining this here.
176
179
# NOTE: make sure to test changes by uncommenting the local_file resource at the bottom of this file
177
180
# and running `terraform apply` to see the generated script. You should also run shellcheck on the script
@@ -214,7 +217,7 @@ locals {
214
217
-v /home/${ local . linux_user } /envbuilder:/workspaces \
215
218
-v /var/run/docker.sock:/var/run/docker.sock \
216
219
--env-file /home/${ local . linux_user } /env.txt \
217
- ${ data . coder_parameter . devcontainer_builder . value }
220
+ ${ local . builder_image }
218
221
META
219
222
}
220
223
You can’t perform that action at this time.
0 commit comments