github.com/pmcatominey/terraform@v0.7.0-rc2.0.20160708105029-1401a52a5cc5/website/source/docs/providers/docker/r/image.html.markdown (about) 1 --- 2 layout: "docker" 3 page_title: "Docker: docker_image" 4 sidebar_current: "docs-docker-resource-image" 5 description: |- 6 Downloads and exports the ID of a Docker image. 7 --- 8 9 # docker\_image 10 11 Downloads and exports the ID of a Docker image. This can be used alongside 12 [docker\_container](/docs/providers/docker/r/container.html) 13 to programmatically get the latest image IDs without having to hardcode 14 them. 15 16 ## Example Usage 17 18 ``` 19 # Find the latest Ubuntu precise image. 20 resource "docker_image" "ubuntu" { 21 name = "ubuntu:precise" 22 } 23 24 # Access it somewhere else with ${docker_image.ubuntu.latest} 25 ``` 26 27 ## Argument Reference 28 29 The following arguments are supported: 30 31 * `name` - (Required, string) The name of the Docker image, including any tags. 32 * `keep_updated` - (Optional, boolean) If true, then the Docker image will 33 always be updated on the host to the latest. If this is false, as long as an 34 image is downloaded with the correct tag, it won't be redownloaded if 35 there is a newer image. 36 * `keep_locally` - (Optional, boolean) If true, then the Docker image won't be 37 deleted on destroy operation. If this is false, it will delete the image from 38 the docker local storage on destroy operation. 39 40 ## Attributes Reference 41 42 The following attributes are exported in addition to the above configuration: 43 44 * `latest` (string) - The ID of the image.