Description:"Manages the lifecycle of a docker image in your docker host. It can be used to build a new docker image or to pull an existing one from a registry.\n This resource will *not* pull new layers of the image automatically unless used in conjunction with [docker_registry_image](../data-sources/registry_image.md) data source to update the `pull_triggers` field.",
Description:"Unique identifier for this resource. This is not the image ID, but the ID of the resource in the Terraform state. This is used to identify the resource in the Terraform state. To reference the correct image ID, use the `image_id` attribute.",
Description:"The ID of the image (as seen when executing `docker inspect` on the image). Can be used to reference the image via its ID in other resources.",
Description:"The image sha256 digest in the form of `repo[:tag]@sha256:<hash>`. This may not be populated when building an image, because it is read from the local Docker client and so may be available only when the image was either pulled from the repo or pushed to the repo (perhaps using `docker_registry_image`) in a previous run.",
Description:"If true, then the Docker image won't be deleted on destroy operation. If this is false, it will delete the image from the docker local storage on destroy operation.",
Description:"List of values which cause an image pull when changed. This is used to store the image digest from the registry when using the [docker_registry_image](../data-sources/registry_image.md).",
Description:"Configuration to build an image. Requires the `Use containerd for pulling and storing images` option to be disabled in the Docker Host(https://github.com/kreuzwerker/terraform-provider-docker/issues/534). Please see [docker build command reference](https://docs.docker.com/engine/reference/commandline/build/#options) too.",
Description:"Value to specify the build context. Currently, only a `PATH` context is supported. You can use the helper function '${path.cwd}/context-dir'. This always refers to the local working directory, even when building images on remote hosts. Please see https://docs.docker.com/build/building/context/ for more information about build contexts.",
Description:"If true the new layers are squashed into a new image with a single new layer",
Optional:true,
ForceNew:true,
},
"cache_from":{
Type:schema.TypeList,
Description:"Images to consider as cache sources",
Optional:true,
ForceNew:true,
Elem:&schema.Schema{
Type:schema.TypeString,
Description:"The image",
},
},
"security_opt":{
Type:schema.TypeList,
Description:"The security options",
Optional:true,
ForceNew:true,
Elem:&schema.Schema{
Type:schema.TypeString,
Description:"The option",
},
},
"extra_hosts":{
Type:schema.TypeList,
Description:"A list of hostnames/IP mappings to add to the container’s /etc/hosts file. Specified in the form [\"hostname:IP\"]",
Optional:true,
ForceNew:true,
Elem:&schema.Schema{
Type:schema.TypeString,
Description:"",
},
},
"target":{
Type:schema.TypeString,
Description:"Set the target build stage to build",
Optional:true,
ForceNew:true,
},
"session_id":{
Type:schema.TypeString,
Description:"Set an ID for the build session",
Optional:true,
ForceNew:true,
},
"platform":{
Type:schema.TypeString,
Description:"Set platform if server is multi-platform capable",
Optional:true,
ForceNew:true,
},
"version":{
Type:schema.TypeString,
Description:"Version of the underlying builder to use",
Optional:true,
ForceNew:true,
},
"build_id":{
Type:schema.TypeString,
Description:"BuildID is an optional identifier that can be passed together with the build request. The same identifier can be used to gracefully cancel the build with the cancel request.",
Description:"Set the name of the buildx builder to use. If not set or empty, the legacy builder will be used.",
Optional:true,
ForceNew:true,
},
"build_log_file":{
Type:schema.TypeString,
Description:"Path to a file where the buildx log are written to. Only available when `builder` is set. If not set, no logs are available. The path is taken as is, so make sure to use a path that is available.",
Description:"A map of arbitrary strings that, when changed, will force the `docker_image` resource to be replaced. This can be used to rebuild an image when contents of source code folders change",