Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c62547

Browse files
authored
fix(examples): add keep_locally to docker_image resources (#16012)
Fixes #15972 Adds `keep_locally = true` to other templates that use the `docker_image` resource to prevent the docker provider from attempting to remove the image upon workspace deletion. We had set this in some other places (such as the `dogfood` template) but had not set this consistently in other templates.
1 parent f3fe3bc commit 9c62547

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

examples/jfrog/docker/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ resource "docker_image" "main" {
144144
triggers = {
145145
dir_sha1 = sha1(join("", [for f in fileset(path.module, "build/*") : filesha1("${path.module}/${f}")]))
146146
}
147+
keep_locally = true
147148
}
148149

149150
resource "docker_container" "workspace" {

examples/parameters/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ resource "docker_image" "main" {
9292
triggers = {
9393
dir_sha1 = sha1(join("", [for f in fileset(path.module, "build/*") : filesha1(f)]))
9494
}
95+
keep_locally = true
9596
}
9697

9798
resource "docker_container" "workspace" {

examples/templates/docker-devcontainer/main.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ data "local_sensitive_file" "cache_repo_dockerconfigjson" {
154154
}
155155

156156
resource "docker_image" "devcontainer_builder_image" {
157-
name = local.devcontainer_builder_image
157+
name = local.devcontainer_builder_image
158+
keep_locally = true
158159
}
159160

160161
resource "docker_volume" "workspaces" {

0 commit comments

Comments
 (0)