mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2025-12-24 00:29:46 -05:00
* chore(ci): Update website-generation workflow * chore(docs): Apply new formatting. * chore: Add update go.mod and go.sum files.
4.9 KiB
4.9 KiB
| page_title | subcategory | description |
|---|---|---|
| Resource docker_registry_image - terraform-provider-docker | Manages the lifecycle of docker image/tag in a registry means it can store one or more version of specific docker images and identified by their tags. |
Resource (docker_registry_image)
Manages the lifecycle of docker image/tag in a registry means it can store one or more version of specific docker images and identified by their tags.
Example Usage
To be able to update an image itself when an updated image arrives.
resource "docker_registry_image" "helloworld" {
name = "helloworld:1.0"
build {
context = "${path.cwd}/absolutePathToContextFolder"
}
}
Schema
Required
name(String) The name of the Docker image.
Optional
build(Block List, Max: 1) Definition for building the image (see below for nested schema)insecure_skip_verify(Boolean) Iftrue, the verification of TLS certificates of the server/registry is disabled. Defaults tofalsekeep_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 tofalse
Read-Only
id(String) The ID of this resource.sha256_digest(String) The sha256 digest of the image.
Nested Schema for build
Required:
context(String) The absolute path to the context folder. You can use the helper function '${path.cwd}/context-dir'.
Optional:
auth_config(Block List) The configuration for the authentication (see below for nested schema)build_args(Map of String) Pairs for build-time variables in the form TODObuild_id(String) 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.cache_from(List of String) Images to consider as cache sourcescgroup_parent(String) Optional parent cgroup for the containercpu_period(Number) The length of a CPU period in microsecondscpu_quota(Number) Microseconds of CPU time that the container can get in a CPU periodcpu_set_cpus(String) CPUs in which to allow execution (e.g.,0-3,0,1)cpu_set_mems(String) MEMs in which to allow execution (0-3,0,1)cpu_shares(Number) CPU shares (relative weight)dockerfile(String) Dockerfile file. Defaults toDockerfileextra_hosts(List of String) A list of hostnames/IP mappings to add to the container’s /etc/hosts file. Specified in the form ["hostname:IP"]force_remove(Boolean) Always remove intermediate containersisolation(String) Isolation represents the isolation technology of a container. The supported values arelabels(Map of String) User-defined key/value metadatamemory(Number) Set memory limit for buildmemory_swap(Number) Total memory (memory + swap), -1 to enable unlimited swapnetwork_mode(String) Set the networking mode for the RUN instructions during buildno_cache(Boolean) Do not use the cache when building the imageplatform(String) Set platform if server is multi-platform capablepull_parent(Boolean) Attempt to pull the image even if an older image exists locallyremote_context(String) A Git repository URI or HTTP/HTTPS context URIremove(Boolean) Remove intermediate containers after a successful build (default behavior)security_opt(List of String) The security optionssession_id(String) Set an ID for the build sessionshm_size(Number) Size of /dev/shm in bytes. The size must be greater than 0squash(Boolean) If true the new layers are squashed into a new image with a single new layersuppress_output(Boolean) Suppress the build output and print image ID on successtarget(String) Set the target build stage to buildulimit(Block List) Configuration for ulimits (see below for nested schema)version(String) Version of the underlying builder to use
Nested Schema for build.auth_config
Required:
host_name(String) hostname of the registry
Optional:
auth(String) the auth tokenemail(String) the user emalidentity_token(String) the identity tokenpassword(String) the registry passwordregistry_token(String) the registry tokenserver_address(String) the server addressuser_name(String) the registry user name
Nested Schema for build.ulimit
Required:
hard(Number) soft limitname(String) type of ulimit, e.g.nofilesoft(Number) hard limit