terraform/website/source/docs/providers/docker/r/image.html.markdown

42 lines
1.1 KiB
Markdown
Raw Normal View History

2015-03-29 04:05:17 +02:00
---
layout: "docker"
page_title: "Docker: docker_image"
sidebar_current: "docs-docker-resource-image"
description: |-
Downloads and exports the ID of a Docker image.
---
# docker\_image
Downloads and exports the ID of a Docker image. This can be used alongside
[docker\_container](/docs/providers/docker/r/container.html)
to programmatically get the latest image IDs without having to hardcode
them.
## Example Usage
```
# Find the latest Ubuntu precise image.
resource "docker_image" "ubuntu" {
image = "ubuntu:precise"
}
# Access it somewhere else with ${docker_image.ubuntu.latest}
```
## Argument Reference
The following arguments are supported:
* `name` - (Required) The name of the Docker image, including any tags.
* `keep_updated` - (Optional) If true, then the Docker image will always
be updated on the host to the latest. If this is false, as long as an
image is downloaded with the correct tag, it won't be redownloaded if
there is a newer image.
## Attributes Reference
The following attributes are exported in addition to the above configuration:
* `latest` (string) - The ID of the image.