2021-05-21 08:30:56 -04:00
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "{{.Type}} {{.Name}} - {{.ProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---
<!-- Bug: Type and Name are switched -->
# {{.Type}} ({{.Name}})
{{ .Description | trimspace }}
## Example Usage
### Basic
Finds and downloads the latest `ubuntu:precise` image but does not check
for further updates of the image
{{tffile "examples/resources/docker_image/resource.tf"}}
### Dynamic updates
2021-06-01 09:05:29 -04:00
To be able to update an image dynamically when the `sha256` sum changes,
2021-05-21 08:30:56 -04:00
you need to use it in combination with `docker_registry_image` as follows:
{{tffile "examples/resources/docker_image/resource-dynamic.tf"}}
### Build
2021-06-01 09:05:29 -04:00
You can also use the resource to build an image.
2021-06-02 01:54:29 -04:00
In this case the image "zoo" and "zoo:develop" are built.
2021-05-21 08:30:56 -04:00
{{tffile "examples/resources/docker_image/resource-build.tf"}}
2022-08-10 07:57:14 -04:00
You can use the `triggers` argument to specify when the image should be rebuild. This is for example helpful when you want to rebuild the docker image whenever the source code changes.
{{tffile "examples/resources/docker_image/resource-build-triggers.tf"}}
2021-06-01 09:05:29 -04:00
{{ .SchemaMarkdown | trimspace }}