terraform-provider-docker/docs/resources/registry_image.md

2.3 KiB

page_title subcategory description
Resource docker_registry_image - terraform-provider-docker Manages the lifecycle of docker image in a registry. You can upload images to a registry (= docker push) and also delete them again

Resource (docker_registry_image)

Manages the lifecycle of docker image in a registry. You can upload images to a registry (= docker push) and also delete them again

Example Usage

Build an image with the docker_image resource and then push it to a registry:

resource "docker_registry_image" "helloworld" {
  name          = docker_image.image.name
  keep_remotely = true
}

resource "docker_image" "image" {
  name = "registry.com/somename:1.0"
  build {
    context = "${path.cwd}/absolutePathToContextFolder"
  }
}

Schema

Required

  • name (String) The name of the Docker image.

Optional

  • auth_config (Block List, Max: 1) Authentication configuration for the Docker registry. It is only used for this resource. (see below for nested schema)
  • insecure_skip_verify (Boolean) If true, the verification of TLS certificates of the server/registry is disabled. Defaults to false
  • keep_remotely (Boolean) 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 registry on destroy operation. Defaults to false
  • timeouts (Block, Optional) (see below for nested schema)
  • triggers (Map of String) A map of arbitrary strings that, when changed, will force the docker_registry_image resource to be replaced. This can be used to repush a local image

Read-Only

  • id (String) The ID of this resource.
  • sha256_digest (String) The sha256 digest of the image.

Nested Schema for auth_config

Required:

  • address (String) The address of the Docker registry.
  • password (String, Sensitive) The password for the Docker registry.
  • username (String) The username for the Docker registry.

Nested Schema for timeouts

Optional:

  • create (String)
  • delete (String)
  • update (String)