mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2026-02-11 23:03:13 -05:00
279 lines
7.3 KiB
Markdown
279 lines
7.3 KiB
Markdown
---
|
|
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
|
page_title: "docker_container Resource - terraform-provider-docker"
|
|
subcategory: ""
|
|
description: |-
|
|
|
|
---
|
|
|
|
# docker_container (Resource)
|
|
|
|
|
|
|
|
|
|
|
|
<!-- schema generated by tfplugindocs -->
|
|
## Schema
|
|
|
|
### Required
|
|
|
|
- **image** (String)
|
|
- **name** (String)
|
|
|
|
### Optional
|
|
|
|
- **attach** (Boolean)
|
|
- **capabilities** (Block Set, Max: 1) (see [below for nested schema](#nestedblock--capabilities))
|
|
- **command** (List of String)
|
|
- **cpu_set** (String)
|
|
- **cpu_shares** (Number)
|
|
- **destroy_grace_seconds** (Number)
|
|
- **devices** (Block Set) (see [below for nested schema](#nestedblock--devices))
|
|
- **dns** (Set of String)
|
|
- **dns_opts** (Set of String)
|
|
- **dns_search** (Set of String)
|
|
- **domainname** (String)
|
|
- **entrypoint** (List of String)
|
|
- **env** (Set of String)
|
|
- **group_add** (Set of String) Additional groups for the container user
|
|
- **healthcheck** (Block List, Max: 1) A test to perform to check that the container is healthy (see [below for nested schema](#nestedblock--healthcheck))
|
|
- **host** (Block Set) (see [below for nested schema](#nestedblock--host))
|
|
- **hostname** (String)
|
|
- **id** (String) The ID of this resource.
|
|
- **init** (Boolean)
|
|
- **ipc_mode** (String) IPC sharing mode for the container
|
|
- **labels** (Block Set) (see [below for nested schema](#nestedblock--labels))
|
|
- **links** (Set of String, Deprecated)
|
|
- **log_driver** (String)
|
|
- **log_opts** (Map of String)
|
|
- **logs** (Boolean)
|
|
- **max_retry_count** (Number)
|
|
- **memory** (Number)
|
|
- **memory_swap** (Number)
|
|
- **mounts** (Block Set) Specification for mounts to be added to containers created as part of the service (see [below for nested schema](#nestedblock--mounts))
|
|
- **must_run** (Boolean)
|
|
- **network_alias** (Set of String, Deprecated) Set an alias for the container in all specified networks
|
|
- **network_mode** (String)
|
|
- **networks** (Set of String, Deprecated)
|
|
- **networks_advanced** (Block Set) (see [below for nested schema](#nestedblock--networks_advanced))
|
|
- **pid_mode** (String)
|
|
- **ports** (Block List) (see [below for nested schema](#nestedblock--ports))
|
|
- **privileged** (Boolean)
|
|
- **publish_all_ports** (Boolean)
|
|
- **read_only** (Boolean)
|
|
- **remove_volumes** (Boolean)
|
|
- **restart** (String)
|
|
- **rm** (Boolean)
|
|
- **security_opts** (Set of String) List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration
|
|
- **shm_size** (Number)
|
|
- **start** (Boolean)
|
|
- **stdin_open** (Boolean)
|
|
- **sysctls** (Map of String)
|
|
- **tmpfs** (Map of String)
|
|
- **tty** (Boolean)
|
|
- **ulimit** (Block Set) (see [below for nested schema](#nestedblock--ulimit))
|
|
- **upload** (Block Set) (see [below for nested schema](#nestedblock--upload))
|
|
- **user** (String)
|
|
- **userns_mode** (String)
|
|
- **volumes** (Block Set) (see [below for nested schema](#nestedblock--volumes))
|
|
- **working_dir** (String)
|
|
|
|
### Read-Only
|
|
|
|
- **bridge** (String)
|
|
- **container_logs** (String)
|
|
- **exit_code** (Number)
|
|
- **gateway** (String, Deprecated)
|
|
- **ip_address** (String, Deprecated)
|
|
- **ip_prefix_length** (Number, Deprecated)
|
|
- **network_data** (List of Object) (see [below for nested schema](#nestedatt--network_data))
|
|
|
|
<a id="nestedblock--capabilities"></a>
|
|
### Nested Schema for `capabilities`
|
|
|
|
Optional:
|
|
|
|
- **add** (Set of String)
|
|
- **drop** (Set of String)
|
|
|
|
|
|
<a id="nestedblock--devices"></a>
|
|
### Nested Schema for `devices`
|
|
|
|
Required:
|
|
|
|
- **host_path** (String)
|
|
|
|
Optional:
|
|
|
|
- **container_path** (String)
|
|
- **permissions** (String)
|
|
|
|
|
|
<a id="nestedblock--healthcheck"></a>
|
|
### Nested Schema for `healthcheck`
|
|
|
|
Required:
|
|
|
|
- **test** (List of String) The test to perform as list
|
|
|
|
Optional:
|
|
|
|
- **interval** (String) Time between running the check (ms|s|m|h)
|
|
- **retries** (Number) Consecutive failures needed to report unhealthy
|
|
- **start_period** (String) Start period for the container to initialize before counting retries towards unstable (ms|s|m|h)
|
|
- **timeout** (String) Maximum time to allow one check to run (ms|s|m|h)
|
|
|
|
|
|
<a id="nestedblock--host"></a>
|
|
### Nested Schema for `host`
|
|
|
|
Required:
|
|
|
|
- **host** (String)
|
|
- **ip** (String)
|
|
|
|
|
|
<a id="nestedblock--labels"></a>
|
|
### Nested Schema for `labels`
|
|
|
|
Required:
|
|
|
|
- **label** (String) Name of the label
|
|
- **value** (String) Value of the label
|
|
|
|
|
|
<a id="nestedblock--mounts"></a>
|
|
### Nested Schema for `mounts`
|
|
|
|
Required:
|
|
|
|
- **target** (String) Container path
|
|
- **type** (String) The mount type
|
|
|
|
Optional:
|
|
|
|
- **bind_options** (Block List, Max: 1) Optional configuration for the bind type (see [below for nested schema](#nestedblock--mounts--bind_options))
|
|
- **read_only** (Boolean) Whether the mount should be read-only
|
|
- **source** (String) Mount source (e.g. a volume name, a host path)
|
|
- **tmpfs_options** (Block List, Max: 1) Optional configuration for the tmpfs type (see [below for nested schema](#nestedblock--mounts--tmpfs_options))
|
|
- **volume_options** (Block List, Max: 1) Optional configuration for the volume type (see [below for nested schema](#nestedblock--mounts--volume_options))
|
|
|
|
<a id="nestedblock--mounts--bind_options"></a>
|
|
### Nested Schema for `mounts.bind_options`
|
|
|
|
Optional:
|
|
|
|
- **propagation** (String) A propagation mode with the value
|
|
|
|
|
|
<a id="nestedblock--mounts--tmpfs_options"></a>
|
|
### Nested Schema for `mounts.tmpfs_options`
|
|
|
|
Optional:
|
|
|
|
- **mode** (Number) The permission mode for the tmpfs mount in an integer
|
|
- **size_bytes** (Number) The size for the tmpfs mount in bytes
|
|
|
|
|
|
<a id="nestedblock--mounts--volume_options"></a>
|
|
### Nested Schema for `mounts.volume_options`
|
|
|
|
Optional:
|
|
|
|
- **driver_name** (String) Name of the driver to use to create the volume
|
|
- **driver_options** (Map of String) key/value map of driver specific options
|
|
- **labels** (Block Set) User-defined key/value metadata (see [below for nested schema](#nestedblock--mounts--volume_options--labels))
|
|
- **no_copy** (Boolean) Populate volume with data from the target
|
|
|
|
<a id="nestedblock--mounts--volume_options--labels"></a>
|
|
### Nested Schema for `mounts.volume_options.labels`
|
|
|
|
Required:
|
|
|
|
- **label** (String) Name of the label
|
|
- **value** (String) Value of the label
|
|
|
|
|
|
|
|
|
|
<a id="nestedblock--networks_advanced"></a>
|
|
### Nested Schema for `networks_advanced`
|
|
|
|
Required:
|
|
|
|
- **name** (String)
|
|
|
|
Optional:
|
|
|
|
- **aliases** (Set of String)
|
|
- **ipv4_address** (String)
|
|
- **ipv6_address** (String)
|
|
|
|
|
|
<a id="nestedblock--ports"></a>
|
|
### Nested Schema for `ports`
|
|
|
|
Required:
|
|
|
|
- **internal** (Number)
|
|
|
|
Optional:
|
|
|
|
- **external** (Number)
|
|
- **ip** (String)
|
|
- **protocol** (String)
|
|
|
|
|
|
<a id="nestedblock--ulimit"></a>
|
|
### Nested Schema for `ulimit`
|
|
|
|
Required:
|
|
|
|
- **hard** (Number)
|
|
- **name** (String)
|
|
- **soft** (Number)
|
|
|
|
|
|
<a id="nestedblock--upload"></a>
|
|
### Nested Schema for `upload`
|
|
|
|
Required:
|
|
|
|
- **file** (String)
|
|
|
|
Optional:
|
|
|
|
- **content** (String)
|
|
- **content_base64** (String)
|
|
- **executable** (Boolean)
|
|
- **source** (String)
|
|
- **source_hash** (String)
|
|
|
|
|
|
<a id="nestedblock--volumes"></a>
|
|
### Nested Schema for `volumes`
|
|
|
|
Optional:
|
|
|
|
- **container_path** (String)
|
|
- **from_container** (String)
|
|
- **host_path** (String)
|
|
- **read_only** (Boolean)
|
|
- **volume_name** (String)
|
|
|
|
|
|
<a id="nestedatt--network_data"></a>
|
|
### Nested Schema for `network_data`
|
|
|
|
Read-Only:
|
|
|
|
- **gateway** (String)
|
|
- **global_ipv6_address** (String)
|
|
- **global_ipv6_prefix_length** (Number)
|
|
- **ip_address** (String)
|
|
- **ip_prefix_length** (Number)
|
|
- **ipv6_gateway** (String)
|
|
- **network_name** (String)
|
|
|
|
|