FEATURES PRICING ABOUT DOCS LOGIN

docker_image

-> Note: The initial (current) version of this resource can only pull public images from the official Docker Hub Registry.

Pulls a Docker image to a given Docker host from a Docker Registry.

This resource will not pull new layers of the image automatically unless used in conjunction with docker_registry_image data source to update the pull_trigger field.

Example Usage

# Find the latest Ubuntu precise image.
resource "docker_image" "ubuntu" {
    name = "ubuntu:precise"
}

# Access it somewhere else with ${docker_image.ubuntu.latest}

Dynamic image

data "docker_registry_image" "ubuntu" {
    name = "ubuntu:precise"
}

resource "docker_image" "ubuntu" {
    name = "${data.docker_registry_image.ubuntu.name}"
    pull_trigger = "${data.docker_registry_image.ubuntu.sha256_digest}"
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported in addition to the above configuration:


See the source of this document at Terraform.io

REQUEST A DEMO