mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2026-01-17 04:02:55 -05:00
4.4 KiB
4.4 KiB
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| docker | Docker: docker_registry_image | docs-docker-resource-registry-image | Manages the lifecycle of docker image/tag in a registry. |
docker_registry_image
Provides an image/tag in a Docker registry.
Example Usage
resource "docker_registry_image" "helloworld" {
name = "helloworld:1.0"
build {
context = "pathToContextFolder"
}
}
Argument Reference
-
name- (Required, string) The name of the Docker image. -
keep_remotely- (Optional, 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. -
build- (Optional, Map) See Build below for details.
Build Block
context(Required, string) - The path to the context foldersuppress_output(Optional, bool) - Suppress the build output and print image ID on successremote_context(Optional, string) - A Git repository URI or HTTP/HTTPS context URIno_cache(Optional, bool) - Do not use the cache when building the imageremove(Optional, bool) - Remove intermediate containers after a successful build (default behavior)force_remove(Optional, bool) - Always remove intermediate containerspull_parent(Optional, bool) - Attempt to pull the image even if an older image exists locallyisolation(Optional, string) - Isolation represents the isolation technology of a container. The supported values are platform specificcpu_set_cpus(Optional, string) - CPUs in which to allow execution (e.g., 0-3, 0,1)cpu_set_mems(Optional, string) - MEMs in which to allow execution (0-3, 0,1)cpu_shares(Optional, int) - CPU shares (relative weight)cpu_quota(Optional, int) - Microseconds of CPU time that the container can get in a CPU periodcpu_period(Optional, int) - The length of a CPU period in microsecondsmemory(Optional, int) - Set memory limit for buildmemory_swap(Optional, int) - Total memory (memory + swap), -1 to enable unlimited swapcgroup_parent(Optional, string) - Optional parent cgroup for the containernetwork_mode(Optional, string) - Set the networking mode for the RUN instructions during buildshm_size(Optional, int) - Size of /dev/shm in bytes. The size must be greater than 0- `` (Optional, string) - Set the networking mode for the RUN instructions during build
dockerfile(Optional, string) - Dockerfile file. Default is "Dockerfile"ulimit(Optional, Map) - See Ulimit below for detailsbuild_args(Optional, map of key/value pairs) string pairs for build-time variablesauth_config(Optional, Map) - See AuthConfig below for detailslabels(Optional, map of key/value pairs) string pairs for labelssquash(Optional, bool) - squash the new layers into a new image with a single new layercache_from(Optional, []string) - Images to consider as cache sourcessecurity_opt(Optional, []string) - Security optionsextra_hosts(Optional, []string) - A list of hostnames/IP mappings to add to the container’s /etc/hosts file. Specified in the form ["hostname:IP"]target(Optional, string) - Set the target build stage to buildplatform(Optional, string) - Set platform if server is multi-platform capableversion(Optional, string) - Version of the unerlying builder to usebuild_id(Optional, 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
Ulimit Block
name- (Required, string) type of ulimit, e.g. nofilesoft(Required, int) - soft limithard(Required, int) - hard limit
AuthConfig Block
host_name- (Required, string) hostname of the registryuser_name- (Optional, string) the registry user namepassword- (Optional, string) the registry passwordauth- (Optional, string) the auth tokenemail- (Optional, string) the user emalserver_address- (Optional, string) the server addressidentity_token- (Optional, string) the identity tokenregistry_token- (Optional, string) the registry token
Attributes Reference
The following attributes are exported in addition to the above configuration:
sha256_digest(string) - The sha256 digest of the image.