Docker

Pulumi Official
Package maintained by Pulumi
v3.2.0 published on Friday, Apr 1, 2022 by Pulumi

Container

Manages the lifecycle of a Docker container.

Example Usage

using Pulumi;
using Docker = Pulumi.Docker;

class MyStack : Stack
{
    public MyStack()
    {
        // Find the latest Ubuntu precise image.
        var ubuntuRemoteImage = new Docker.RemoteImage("ubuntuRemoteImage", new Docker.RemoteImageArgs
        {
            Name = "ubuntu:precise",
        });
        // Start a container
        var ubuntuContainer = new Docker.Container("ubuntuContainer", new Docker.ContainerArgs
        {
            Image = ubuntuRemoteImage.Latest,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-docker/sdk/v3/go/docker"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ubuntuRemoteImage, err := docker.NewRemoteImage(ctx, "ubuntuRemoteImage", &docker.RemoteImageArgs{
			Name: pulumi.String("ubuntu:precise"),
		})
		if err != nil {
			return err
		}
		_, err = docker.NewContainer(ctx, "ubuntuContainer", &docker.ContainerArgs{
			Image: ubuntuRemoteImage.Latest,
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_docker as docker

# Find the latest Ubuntu precise image.
ubuntu_remote_image = docker.RemoteImage("ubuntuRemoteImage", name="ubuntu:precise")
# Start a container
ubuntu_container = docker.Container("ubuntuContainer", image=ubuntu_remote_image.latest)
import * as pulumi from "@pulumi/pulumi";
import * as docker from "@pulumi/docker";

// Find the latest Ubuntu precise image.
const ubuntuRemoteImage = new docker.RemoteImage("ubuntuRemoteImage", {name: "ubuntu:precise"});
// Start a container
const ubuntuContainer = new docker.Container("ubuntuContainer", {image: ubuntuRemoteImage.latest});

Coming soon!

Create a Container Resource

new Container(name: string, args: ContainerArgs, opts?: CustomResourceOptions);
@overload
def Container(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              attach: Optional[bool] = None,
              capabilities: Optional[ContainerCapabilitiesArgs] = None,
              command: Optional[Sequence[str]] = None,
              cpu_set: Optional[str] = None,
              cpu_shares: Optional[int] = None,
              destroy_grace_seconds: Optional[int] = None,
              devices: Optional[Sequence[ContainerDeviceArgs]] = None,
              dns: Optional[Sequence[str]] = None,
              dns_opts: Optional[Sequence[str]] = None,
              dns_searches: Optional[Sequence[str]] = None,
              domainname: Optional[str] = None,
              entrypoints: Optional[Sequence[str]] = None,
              envs: Optional[Sequence[str]] = None,
              group_adds: Optional[Sequence[str]] = None,
              healthcheck: Optional[ContainerHealthcheckArgs] = None,
              hostname: Optional[str] = None,
              hosts: Optional[Sequence[ContainerHostArgs]] = None,
              image: Optional[str] = None,
              init: Optional[bool] = None,
              ipc_mode: Optional[str] = None,
              labels: Optional[Sequence[ContainerLabelArgs]] = None,
              links: Optional[Sequence[str]] = None,
              log_driver: Optional[str] = None,
              log_opts: Optional[Mapping[str, Any]] = None,
              logs: Optional[bool] = None,
              max_retry_count: Optional[int] = None,
              memory: Optional[int] = None,
              memory_swap: Optional[int] = None,
              mounts: Optional[Sequence[ContainerMountArgs]] = None,
              must_run: Optional[bool] = None,
              name: Optional[str] = None,
              network_aliases: Optional[Sequence[str]] = None,
              network_mode: Optional[str] = None,
              networks: Optional[Sequence[str]] = None,
              networks_advanced: Optional[Sequence[ContainerNetworksAdvancedArgs]] = None,
              pid_mode: Optional[str] = None,
              ports: Optional[Sequence[ContainerPortArgs]] = None,
              privileged: Optional[bool] = None,
              publish_all_ports: Optional[bool] = None,
              read_only: Optional[bool] = None,
              remove_volumes: Optional[bool] = None,
              restart: Optional[str] = None,
              rm: Optional[bool] = None,
              security_opts: Optional[Sequence[str]] = None,
              shm_size: Optional[int] = None,
              start: Optional[bool] = None,
              stdin_open: Optional[bool] = None,
              storage_opts: Optional[Mapping[str, Any]] = None,
              sysctls: Optional[Mapping[str, Any]] = None,
              tmpfs: Optional[Mapping[str, Any]] = None,
              tty: Optional[bool] = None,
              ulimits: Optional[Sequence[ContainerUlimitArgs]] = None,
              uploads: Optional[Sequence[ContainerUploadArgs]] = None,
              user: Optional[str] = None,
              userns_mode: Optional[str] = None,
              volumes: Optional[Sequence[ContainerVolumeArgs]] = None,
              working_dir: Optional[str] = None)
@overload
def Container(resource_name: str,
              args: ContainerArgs,
              opts: Optional[ResourceOptions] = None)
func NewContainer(ctx *Context, name string, args ContainerArgs, opts ...ResourceOption) (*Container, error)
public Container(string name, ContainerArgs args, CustomResourceOptions? opts = null)
public Container(String name, ContainerArgs args)
public Container(String name, ContainerArgs args, CustomResourceOptions options)
type: docker:Container
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ContainerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ContainerArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ContainerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ContainerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ContainerArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Container Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Container resource accepts the following input properties:

Image string

The ID of the image to back this container. The easiest way to get this value is to use the docker.RemoteImage resource as is shown in the example.

Attach bool

If true attach to the container after its creation and waits the end of its execution. Defaults to false.

Capabilities ContainerCapabilitiesArgs

Add or drop certrain linux capabilities.

Command List<string>

The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram","-","baz.con"].

CpuSet string

A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1.

CpuShares int

CPU shares (relative weight) for the container.

DestroyGraceSeconds int

If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop.

Devices List<ContainerDeviceArgs>

Bind devices to the container.

Dns List<string>

DNS servers to use.

DnsOpts List<string>

DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options.

DnsSearches List<string>

DNS search domains that are used when bare unqualified hostnames are used inside of the container.

Domainname string

Domain name of the container.

Entrypoints List<string>

The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be "/usr/bin/myprogra"].

Envs List<string>

Environment variables to set in the form of KEY=VALUE, e.g. DEBUG=0

GroupAdds List<string>

Additional groups for the container user

Healthcheck ContainerHealthcheckArgs

A test to perform to check that the container is healthy

Hostname string

Hostname of the container.

Hosts List<ContainerHostArgs>

Additional hosts to add to the container.

Init bool

Configured whether an init process should be injected for this container. If unset this will default to the dockerd defaults.

IpcMode string

IPC sharing mode for the container. Possible values are: none, private, shareable, container:<name|id> or host.

Labels List<ContainerLabelArgs>

User-defined key/value metadata

Links List<string>

Set of links for link based connectivity between containers that are running on the same host.

Deprecated:

The --link flag is a legacy feature of Docker. It may eventually be removed.

LogDriver string

The logging driver to use for the container.

LogOpts Dictionary<string, object>

Key/value pairs to use as options for the logging driver.

Logs bool

Save the container logs (attach must be enabled). Defaults to false.

MaxRetryCount int

The maximum amount of times to an attempt a restart when restart is set to 'on-failure'.

Memory int

The memory limit for the container in MBs.

MemorySwap int

The total memory limit (memory + swap) for the container in MBs. This setting may compute to -1 after terraform apply if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.

Mounts List<ContainerMountArgs>

Specification for mounts to be added to containers created as part of the service.

MustRun bool

If true, then the Docker container will be kept running. If false, then as long as the container exists, Terraform assumes it is successful. Defaults to true.

Name string

The name of the container.

NetworkAliases List<string>

Set an alias for the container in all specified networks

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

NetworkMode string

Network mode of the container.

Networks List<string>

ID of the networks in which the container is.

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

NetworksAdvanced List<ContainerNetworksAdvancedArgs>

The networks the container is attached to

PidMode string

he PID (Process) Namespace mode for the container. Either container:<name|id> or host.

Ports List<ContainerPortArgs>

Publish a container's port(s) to the host.

Privileged bool

If true, the container runs in privileged mode.

PublishAllPorts bool

Publish all ports of the container.

ReadOnly bool

If true, the container will be started as readonly. Defaults to false.

RemoveVolumes bool

If true, it will remove anonymous volumes associated with the container. Defaults to true.

Restart string

The restart policy for the container. Must be one of 'no', 'on-failure', 'always', 'unless-stopped'. Defaults to no.

Rm bool

If true, then the container will be automatically removed when it exits. Defaults to false.

SecurityOpts List<string>

List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.

ShmSize int

Size of /dev/shm in MBs.

Start bool

If true, then the Docker container will be started after creation. If false, then the container is only created. Defaults to true.

StdinOpen bool

If true, keep STDIN open even if not attached (docker run -i). Defaults to false.

StorageOpts Dictionary<string, object>

Key/value pairs for the storage driver options, e.g. size: 120G

Sysctls Dictionary<string, object>

A map of kernel parameters (sysctls) to set in the container.

Tmpfs Dictionary<string, object>

A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options.

Tty bool

If true, allocate a pseudo-tty (docker run -t). Defaults to false.

Ulimits List<ContainerUlimitArgs>

Ulimit options to add.

Uploads List<ContainerUploadArgs>

Specifies files to upload to the container before starting it. Only one of content or content_base64 can be set and at least one of them has to be set.

User string

User used for run the first process. Format is user or user:group which user and group can be passed literraly or by name.

UsernsMode string

Sets the usernamespace mode for the container when usernamespace remapping option is enabled.

Volumes List<ContainerVolumeArgs>

Spec for mounting volumes in the container.

WorkingDir string

The working directory for commands to run in.

Image string

The ID of the image to back this container. The easiest way to get this value is to use the docker.RemoteImage resource as is shown in the example.

Attach bool

If true attach to the container after its creation and waits the end of its execution. Defaults to false.

Capabilities ContainerCapabilitiesArgs

Add or drop certrain linux capabilities.

Command []string

The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram","-","baz.con"].

CpuSet string

A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1.

CpuShares int

CPU shares (relative weight) for the container.

DestroyGraceSeconds int

If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop.

Devices []ContainerDeviceArgs

Bind devices to the container.

Dns []string

DNS servers to use.

DnsOpts []string

DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options.

DnsSearches []string

DNS search domains that are used when bare unqualified hostnames are used inside of the container.

Domainname string

Domain name of the container.

Entrypoints []string

The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be "/usr/bin/myprogra"].

Envs []string

Environment variables to set in the form of KEY=VALUE, e.g. DEBUG=0

GroupAdds []string

Additional groups for the container user

Healthcheck ContainerHealthcheckArgs

A test to perform to check that the container is healthy

Hostname string

Hostname of the container.

Hosts []ContainerHostArgs

Additional hosts to add to the container.

Init bool

Configured whether an init process should be injected for this container. If unset this will default to the dockerd defaults.

IpcMode string

IPC sharing mode for the container. Possible values are: none, private, shareable, container:<name|id> or host.

Labels []ContainerLabelArgs

User-defined key/value metadata

Links []string

Set of links for link based connectivity between containers that are running on the same host.

Deprecated:

The --link flag is a legacy feature of Docker. It may eventually be removed.

LogDriver string

The logging driver to use for the container.

LogOpts map[string]interface{}

Key/value pairs to use as options for the logging driver.

Logs bool

Save the container logs (attach must be enabled). Defaults to false.

MaxRetryCount int

The maximum amount of times to an attempt a restart when restart is set to 'on-failure'.

Memory int

The memory limit for the container in MBs.

MemorySwap int

The total memory limit (memory + swap) for the container in MBs. This setting may compute to -1 after terraform apply if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.

Mounts []ContainerMountArgs

Specification for mounts to be added to containers created as part of the service.

MustRun bool

If true, then the Docker container will be kept running. If false, then as long as the container exists, Terraform assumes it is successful. Defaults to true.

Name string

The name of the container.

NetworkAliases []string

Set an alias for the container in all specified networks

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

NetworkMode string

Network mode of the container.

Networks []string

ID of the networks in which the container is.

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

NetworksAdvanced []ContainerNetworksAdvancedArgs

The networks the container is attached to

PidMode string

he PID (Process) Namespace mode for the container. Either container:<name|id> or host.

Ports []ContainerPortArgs

Publish a container's port(s) to the host.

Privileged bool

If true, the container runs in privileged mode.

PublishAllPorts bool

Publish all ports of the container.

ReadOnly bool

If true, the container will be started as readonly. Defaults to false.

RemoveVolumes bool

If true, it will remove anonymous volumes associated with the container. Defaults to true.

Restart string

The restart policy for the container. Must be one of 'no', 'on-failure', 'always', 'unless-stopped'. Defaults to no.

Rm bool

If true, then the container will be automatically removed when it exits. Defaults to false.

SecurityOpts []string

List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.

ShmSize int

Size of /dev/shm in MBs.

Start bool

If true, then the Docker container will be started after creation. If false, then the container is only created. Defaults to true.

StdinOpen bool

If true, keep STDIN open even if not attached (docker run -i). Defaults to false.

StorageOpts map[string]interface{}

Key/value pairs for the storage driver options, e.g. size: 120G

Sysctls map[string]interface{}

A map of kernel parameters (sysctls) to set in the container.

Tmpfs map[string]interface{}

A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options.

Tty bool

If true, allocate a pseudo-tty (docker run -t). Defaults to false.

Ulimits []ContainerUlimitArgs

Ulimit options to add.

Uploads []ContainerUploadArgs

Specifies files to upload to the container before starting it. Only one of content or content_base64 can be set and at least one of them has to be set.

User string

User used for run the first process. Format is user or user:group which user and group can be passed literraly or by name.

UsernsMode string

Sets the usernamespace mode for the container when usernamespace remapping option is enabled.

Volumes []ContainerVolumeArgs

Spec for mounting volumes in the container.

WorkingDir string

The working directory for commands to run in.

image String

The ID of the image to back this container. The easiest way to get this value is to use the docker.RemoteImage resource as is shown in the example.

attach Boolean

If true attach to the container after its creation and waits the end of its execution. Defaults to false.

capabilities ContainerCapabilitiesArgs

Add or drop certrain linux capabilities.

command List

The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram","-","baz.con"].

cpuSet String

A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1.

cpuShares Integer

CPU shares (relative weight) for the container.

destroyGraceSeconds Integer

If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop.

devices ListDeviceArgs>

Bind devices to the container.

dns List

DNS servers to use.

dnsOpts List

DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options.

dnsSearches List

DNS search domains that are used when bare unqualified hostnames are used inside of the container.

domainname String

Domain name of the container.

entrypoints List

The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be "/usr/bin/myprogra"].

envs List

Environment variables to set in the form of KEY=VALUE, e.g. DEBUG=0

groupAdds List

Additional groups for the container user

healthcheck ContainerHealthcheckArgs

A test to perform to check that the container is healthy

hostname String

Hostname of the container.

hosts ListHostArgs>

Additional hosts to add to the container.

init Boolean

Configured whether an init process should be injected for this container. If unset this will default to the dockerd defaults.

ipcMode String

IPC sharing mode for the container. Possible values are: none, private, shareable, container:<name|id> or host.

labels ListLabelArgs>

User-defined key/value metadata

links List

Set of links for link based connectivity between containers that are running on the same host.

Deprecated:

The --link flag is a legacy feature of Docker. It may eventually be removed.

logDriver String

The logging driver to use for the container.

logOpts Map

Key/value pairs to use as options for the logging driver.

logs Boolean

Save the container logs (attach must be enabled). Defaults to false.

maxRetryCount Integer

The maximum amount of times to an attempt a restart when restart is set to 'on-failure'.

memory Integer

The memory limit for the container in MBs.

memorySwap Integer

The total memory limit (memory + swap) for the container in MBs. This setting may compute to -1 after terraform apply if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.

mounts ListMountArgs>

Specification for mounts to be added to containers created as part of the service.

mustRun Boolean

If true, then the Docker container will be kept running. If false, then as long as the container exists, Terraform assumes it is successful. Defaults to true.

name String

The name of the container.

networkAliases List

Set an alias for the container in all specified networks

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

networkMode String

Network mode of the container.

networks List

ID of the networks in which the container is.

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

networksAdvanced ListNetworksAdvancedArgs>

The networks the container is attached to

pidMode String

he PID (Process) Namespace mode for the container. Either container:<name|id> or host.

ports ListPortArgs>

Publish a container's port(s) to the host.

privileged Boolean

If true, the container runs in privileged mode.

publishAllPorts Boolean

Publish all ports of the container.

readOnly Boolean

If true, the container will be started as readonly. Defaults to false.

removeVolumes Boolean

If true, it will remove anonymous volumes associated with the container. Defaults to true.

restart String

The restart policy for the container. Must be one of 'no', 'on-failure', 'always', 'unless-stopped'. Defaults to no.

rm Boolean

If true, then the container will be automatically removed when it exits. Defaults to false.

securityOpts List

List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.

shmSize Integer

Size of /dev/shm in MBs.

start Boolean

If true, then the Docker container will be started after creation. If false, then the container is only created. Defaults to true.

stdinOpen Boolean

If true, keep STDIN open even if not attached (docker run -i). Defaults to false.

storageOpts Map

Key/value pairs for the storage driver options, e.g. size: 120G

sysctls Map

A map of kernel parameters (sysctls) to set in the container.

tmpfs Map

A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options.

tty Boolean

If true, allocate a pseudo-tty (docker run -t). Defaults to false.

ulimits ListUlimitArgs>

Ulimit options to add.

uploads ListUploadArgs>

Specifies files to upload to the container before starting it. Only one of content or content_base64 can be set and at least one of them has to be set.

user String

User used for run the first process. Format is user or user:group which user and group can be passed literraly or by name.

usernsMode String

Sets the usernamespace mode for the container when usernamespace remapping option is enabled.

volumes ListVolumeArgs>

Spec for mounting volumes in the container.

workingDir String

The working directory for commands to run in.

image string

The ID of the image to back this container. The easiest way to get this value is to use the docker.RemoteImage resource as is shown in the example.

attach boolean

If true attach to the container after its creation and waits the end of its execution. Defaults to false.

capabilities ContainerCapabilitiesArgs

Add or drop certrain linux capabilities.

command string[]

The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram","-","baz.con"].

cpuSet string

A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1.

cpuShares number

CPU shares (relative weight) for the container.

destroyGraceSeconds number

If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop.

devices ContainerDeviceArgs[]

Bind devices to the container.

dns string[]

DNS servers to use.

dnsOpts string[]

DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options.

dnsSearches string[]

DNS search domains that are used when bare unqualified hostnames are used inside of the container.

domainname string

Domain name of the container.

entrypoints string[]

The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be "/usr/bin/myprogra"].

envs string[]

Environment variables to set in the form of KEY=VALUE, e.g. DEBUG=0

groupAdds string[]

Additional groups for the container user

healthcheck ContainerHealthcheckArgs

A test to perform to check that the container is healthy

hostname string

Hostname of the container.

hosts ContainerHostArgs[]

Additional hosts to add to the container.

init boolean

Configured whether an init process should be injected for this container. If unset this will default to the dockerd defaults.

ipcMode string

IPC sharing mode for the container. Possible values are: none, private, shareable, container:<name|id> or host.

labels ContainerLabelArgs[]

User-defined key/value metadata

links string[]

Set of links for link based connectivity between containers that are running on the same host.

Deprecated:

The --link flag is a legacy feature of Docker. It may eventually be removed.

logDriver string

The logging driver to use for the container.

logOpts {[key: string]: any}

Key/value pairs to use as options for the logging driver.

logs boolean

Save the container logs (attach must be enabled). Defaults to false.

maxRetryCount number

The maximum amount of times to an attempt a restart when restart is set to 'on-failure'.

memory number

The memory limit for the container in MBs.

memorySwap number

The total memory limit (memory + swap) for the container in MBs. This setting may compute to -1 after terraform apply if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.

mounts ContainerMountArgs[]

Specification for mounts to be added to containers created as part of the service.

mustRun boolean

If true, then the Docker container will be kept running. If false, then as long as the container exists, Terraform assumes it is successful. Defaults to true.

name string

The name of the container.

networkAliases string[]

Set an alias for the container in all specified networks

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

networkMode string

Network mode of the container.

networks string[]

ID of the networks in which the container is.

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

networksAdvanced ContainerNetworksAdvancedArgs[]

The networks the container is attached to

pidMode string

he PID (Process) Namespace mode for the container. Either container:<name|id> or host.

ports ContainerPortArgs[]

Publish a container's port(s) to the host.

privileged boolean

If true, the container runs in privileged mode.

publishAllPorts boolean

Publish all ports of the container.

readOnly boolean

If true, the container will be started as readonly. Defaults to false.

removeVolumes boolean

If true, it will remove anonymous volumes associated with the container. Defaults to true.

restart string

The restart policy for the container. Must be one of 'no', 'on-failure', 'always', 'unless-stopped'. Defaults to no.

rm boolean

If true, then the container will be automatically removed when it exits. Defaults to false.

securityOpts string[]

List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.

shmSize number

Size of /dev/shm in MBs.

start boolean

If true, then the Docker container will be started after creation. If false, then the container is only created. Defaults to true.

stdinOpen boolean

If true, keep STDIN open even if not attached (docker run -i). Defaults to false.

storageOpts {[key: string]: any}

Key/value pairs for the storage driver options, e.g. size: 120G

sysctls {[key: string]: any}

A map of kernel parameters (sysctls) to set in the container.

tmpfs {[key: string]: any}

A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options.

tty boolean

If true, allocate a pseudo-tty (docker run -t). Defaults to false.

ulimits ContainerUlimitArgs[]

Ulimit options to add.

uploads ContainerUploadArgs[]

Specifies files to upload to the container before starting it. Only one of content or content_base64 can be set and at least one of them has to be set.

user string

User used for run the first process. Format is user or user:group which user and group can be passed literraly or by name.

usernsMode string

Sets the usernamespace mode for the container when usernamespace remapping option is enabled.

volumes ContainerVolumeArgs[]

Spec for mounting volumes in the container.

workingDir string

The working directory for commands to run in.

image str

The ID of the image to back this container. The easiest way to get this value is to use the docker.RemoteImage resource as is shown in the example.

attach bool

If true attach to the container after its creation and waits the end of its execution. Defaults to false.

capabilities ContainerCapabilitiesArgs

Add or drop certrain linux capabilities.

command Sequence[str]

The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram","-","baz.con"].

cpu_set str

A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1.

cpu_shares int

CPU shares (relative weight) for the container.

destroy_grace_seconds int

If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop.

devices Sequence[ContainerDeviceArgs]

Bind devices to the container.

dns Sequence[str]

DNS servers to use.

dns_opts Sequence[str]

DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options.

dns_searches Sequence[str]

DNS search domains that are used when bare unqualified hostnames are used inside of the container.

domainname str

Domain name of the container.

entrypoints Sequence[str]

The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be "/usr/bin/myprogra"].

envs Sequence[str]

Environment variables to set in the form of KEY=VALUE, e.g. DEBUG=0

group_adds Sequence[str]

Additional groups for the container user

healthcheck ContainerHealthcheckArgs

A test to perform to check that the container is healthy

hostname str

Hostname of the container.

hosts Sequence[ContainerHostArgs]

Additional hosts to add to the container.

init bool

Configured whether an init process should be injected for this container. If unset this will default to the dockerd defaults.

ipc_mode str

IPC sharing mode for the container. Possible values are: none, private, shareable, container:<name|id> or host.

labels Sequence[ContainerLabelArgs]

User-defined key/value metadata

links Sequence[str]

Set of links for link based connectivity between containers that are running on the same host.

Deprecated:

The --link flag is a legacy feature of Docker. It may eventually be removed.

log_driver str

The logging driver to use for the container.

log_opts Mapping[str, Any]

Key/value pairs to use as options for the logging driver.

logs bool

Save the container logs (attach must be enabled). Defaults to false.

max_retry_count int

The maximum amount of times to an attempt a restart when restart is set to 'on-failure'.

memory int

The memory limit for the container in MBs.

memory_swap int

The total memory limit (memory + swap) for the container in MBs. This setting may compute to -1 after terraform apply if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.

mounts Sequence[ContainerMountArgs]

Specification for mounts to be added to containers created as part of the service.

must_run bool

If true, then the Docker container will be kept running. If false, then as long as the container exists, Terraform assumes it is successful. Defaults to true.

name str

The name of the container.

network_aliases Sequence[str]

Set an alias for the container in all specified networks

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

network_mode str

Network mode of the container.

networks Sequence[str]

ID of the networks in which the container is.

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

networks_advanced Sequence[ContainerNetworksAdvancedArgs]

The networks the container is attached to

pid_mode str

he PID (Process) Namespace mode for the container. Either container:<name|id> or host.

ports Sequence[ContainerPortArgs]

Publish a container's port(s) to the host.

privileged bool

If true, the container runs in privileged mode.

publish_all_ports bool

Publish all ports of the container.

read_only bool

If true, the container will be started as readonly. Defaults to false.

remove_volumes bool

If true, it will remove anonymous volumes associated with the container. Defaults to true.

restart str

The restart policy for the container. Must be one of 'no', 'on-failure', 'always', 'unless-stopped'. Defaults to no.

rm bool

If true, then the container will be automatically removed when it exits. Defaults to false.

security_opts Sequence[str]

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 int

Size of /dev/shm in MBs.

start bool

If true, then the Docker container will be started after creation. If false, then the container is only created. Defaults to true.

stdin_open bool

If true, keep STDIN open even if not attached (docker run -i). Defaults to false.

storage_opts Mapping[str, Any]

Key/value pairs for the storage driver options, e.g. size: 120G

sysctls Mapping[str, Any]

A map of kernel parameters (sysctls) to set in the container.

tmpfs Mapping[str, Any]

A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options.

tty bool

If true, allocate a pseudo-tty (docker run -t). Defaults to false.

ulimits Sequence[ContainerUlimitArgs]

Ulimit options to add.

uploads Sequence[ContainerUploadArgs]

Specifies files to upload to the container before starting it. Only one of content or content_base64 can be set and at least one of them has to be set.

user str

User used for run the first process. Format is user or user:group which user and group can be passed literraly or by name.

userns_mode str

Sets the usernamespace mode for the container when usernamespace remapping option is enabled.

volumes Sequence[ContainerVolumeArgs]

Spec for mounting volumes in the container.

working_dir str

The working directory for commands to run in.

image String

The ID of the image to back this container. The easiest way to get this value is to use the docker.RemoteImage resource as is shown in the example.

attach Boolean

If true attach to the container after its creation and waits the end of its execution. Defaults to false.

capabilities Property Map

Add or drop certrain linux capabilities.

command List

The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram","-","baz.con"].

cpuSet String

A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1.

cpuShares Number

CPU shares (relative weight) for the container.

destroyGraceSeconds Number

If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop.

devices List

Bind devices to the container.

dns List

DNS servers to use.

dnsOpts List

DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options.

dnsSearches List

DNS search domains that are used when bare unqualified hostnames are used inside of the container.

domainname String

Domain name of the container.

entrypoints List

The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be "/usr/bin/myprogra"].

envs List

Environment variables to set in the form of KEY=VALUE, e.g. DEBUG=0

groupAdds List

Additional groups for the container user

healthcheck Property Map

A test to perform to check that the container is healthy

hostname String

Hostname of the container.

hosts List

Additional hosts to add to the container.

init Boolean

Configured whether an init process should be injected for this container. If unset this will default to the dockerd defaults.

ipcMode String

IPC sharing mode for the container. Possible values are: none, private, shareable, container:<name|id> or host.

labels List

User-defined key/value metadata

links List

Set of links for link based connectivity between containers that are running on the same host.

Deprecated:

The --link flag is a legacy feature of Docker. It may eventually be removed.

logDriver String

The logging driver to use for the container.

logOpts Map

Key/value pairs to use as options for the logging driver.

logs Boolean

Save the container logs (attach must be enabled). Defaults to false.

maxRetryCount Number

The maximum amount of times to an attempt a restart when restart is set to 'on-failure'.

memory Number

The memory limit for the container in MBs.

memorySwap Number

The total memory limit (memory + swap) for the container in MBs. This setting may compute to -1 after terraform apply if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.

mounts List

Specification for mounts to be added to containers created as part of the service.

mustRun Boolean

If true, then the Docker container will be kept running. If false, then as long as the container exists, Terraform assumes it is successful. Defaults to true.

name String

The name of the container.

networkAliases List

Set an alias for the container in all specified networks

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

networkMode String

Network mode of the container.

networks List

ID of the networks in which the container is.

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

networksAdvanced List

The networks the container is attached to

pidMode String

he PID (Process) Namespace mode for the container. Either container:<name|id> or host.

ports List

Publish a container's port(s) to the host.

privileged Boolean

If true, the container runs in privileged mode.

publishAllPorts Boolean

Publish all ports of the container.

readOnly Boolean

If true, the container will be started as readonly. Defaults to false.

removeVolumes Boolean

If true, it will remove anonymous volumes associated with the container. Defaults to true.

restart String

The restart policy for the container. Must be one of 'no', 'on-failure', 'always', 'unless-stopped'. Defaults to no.

rm Boolean

If true, then the container will be automatically removed when it exits. Defaults to false.

securityOpts List

List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.

shmSize Number

Size of /dev/shm in MBs.

start Boolean

If true, then the Docker container will be started after creation. If false, then the container is only created. Defaults to true.

stdinOpen Boolean

If true, keep STDIN open even if not attached (docker run -i). Defaults to false.

storageOpts Map

Key/value pairs for the storage driver options, e.g. size: 120G

sysctls Map

A map of kernel parameters (sysctls) to set in the container.

tmpfs Map

A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options.

tty Boolean

If true, allocate a pseudo-tty (docker run -t). Defaults to false.

ulimits List

Ulimit options to add.

uploads List

Specifies files to upload to the container before starting it. Only one of content or content_base64 can be set and at least one of them has to be set.

user String

User used for run the first process. Format is user or user:group which user and group can be passed literraly or by name.

usernsMode String

Sets the usernamespace mode for the container when usernamespace remapping option is enabled.

volumes List

Spec for mounting volumes in the container.

workingDir String

The working directory for commands to run in.

Outputs

All input properties are implicitly available as output properties. Additionally, the Container resource produces the following output properties:

Bridge string

The network bridge of the container as read from its NetworkSettings.

ContainerLogs string

The logs of the container if its execution is done (attach must be disabled).

ExitCode int

The exit code of the container if its execution is done (must_run must be disabled).

Gateway string

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

Id string

The provider-assigned unique ID for this managed resource.

IpAddress string

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

IpPrefixLength int

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

NetworkDatas List<ContainerNetworkData>

The data of the networks the container is connected to.

Bridge string

The network bridge of the container as read from its NetworkSettings.

ContainerLogs string

The logs of the container if its execution is done (attach must be disabled).

ExitCode int

The exit code of the container if its execution is done (must_run must be disabled).

Gateway string

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

Id string

The provider-assigned unique ID for this managed resource.

IpAddress string

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

IpPrefixLength int

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

NetworkDatas []ContainerNetworkData

The data of the networks the container is connected to.

bridge String

The network bridge of the container as read from its NetworkSettings.

containerLogs String

The logs of the container if its execution is done (attach must be disabled).

exitCode Integer

The exit code of the container if its execution is done (must_run must be disabled).

gateway String

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

id String

The provider-assigned unique ID for this managed resource.

ipAddress String

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

ipPrefixLength Integer

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

networkDatas ListNetworkData>

The data of the networks the container is connected to.

bridge string

The network bridge of the container as read from its NetworkSettings.

containerLogs string

The logs of the container if its execution is done (attach must be disabled).

exitCode number

The exit code of the container if its execution is done (must_run must be disabled).

gateway string

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

id string

The provider-assigned unique ID for this managed resource.

ipAddress string

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

ipPrefixLength number

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

networkDatas ContainerNetworkData[]

The data of the networks the container is connected to.

bridge str

The network bridge of the container as read from its NetworkSettings.

container_logs str

The logs of the container if its execution is done (attach must be disabled).

exit_code int

The exit code of the container if its execution is done (must_run must be disabled).

gateway str

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

id str

The provider-assigned unique ID for this managed resource.

ip_address str

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

ip_prefix_length int

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

network_datas Sequence[ContainerNetworkData]

The data of the networks the container is connected to.

bridge String

The network bridge of the container as read from its NetworkSettings.

containerLogs String

The logs of the container if its execution is done (attach must be disabled).

exitCode Number

The exit code of the container if its execution is done (must_run must be disabled).

gateway String

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

id String

The provider-assigned unique ID for this managed resource.

ipAddress String

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

ipPrefixLength Number

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

networkDatas List

The data of the networks the container is connected to.

Look up an Existing Container Resource

Get an existing Container resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ContainerState, opts?: CustomResourceOptions): Container
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        attach: Optional[bool] = None,
        bridge: Optional[str] = None,
        capabilities: Optional[ContainerCapabilitiesArgs] = None,
        command: Optional[Sequence[str]] = None,
        container_logs: Optional[str] = None,
        cpu_set: Optional[str] = None,
        cpu_shares: Optional[int] = None,
        destroy_grace_seconds: Optional[int] = None,
        devices: Optional[Sequence[ContainerDeviceArgs]] = None,
        dns: Optional[Sequence[str]] = None,
        dns_opts: Optional[Sequence[str]] = None,
        dns_searches: Optional[Sequence[str]] = None,
        domainname: Optional[str] = None,
        entrypoints: Optional[Sequence[str]] = None,
        envs: Optional[Sequence[str]] = None,
        exit_code: Optional[int] = None,
        gateway: Optional[str] = None,
        group_adds: Optional[Sequence[str]] = None,
        healthcheck: Optional[ContainerHealthcheckArgs] = None,
        hostname: Optional[str] = None,
        hosts: Optional[Sequence[ContainerHostArgs]] = None,
        image: Optional[str] = None,
        init: Optional[bool] = None,
        ip_address: Optional[str] = None,
        ip_prefix_length: Optional[int] = None,
        ipc_mode: Optional[str] = None,
        labels: Optional[Sequence[ContainerLabelArgs]] = None,
        links: Optional[Sequence[str]] = None,
        log_driver: Optional[str] = None,
        log_opts: Optional[Mapping[str, Any]] = None,
        logs: Optional[bool] = None,
        max_retry_count: Optional[int] = None,
        memory: Optional[int] = None,
        memory_swap: Optional[int] = None,
        mounts: Optional[Sequence[ContainerMountArgs]] = None,
        must_run: Optional[bool] = None,
        name: Optional[str] = None,
        network_aliases: Optional[Sequence[str]] = None,
        network_datas: Optional[Sequence[ContainerNetworkDataArgs]] = None,
        network_mode: Optional[str] = None,
        networks: Optional[Sequence[str]] = None,
        networks_advanced: Optional[Sequence[ContainerNetworksAdvancedArgs]] = None,
        pid_mode: Optional[str] = None,
        ports: Optional[Sequence[ContainerPortArgs]] = None,
        privileged: Optional[bool] = None,
        publish_all_ports: Optional[bool] = None,
        read_only: Optional[bool] = None,
        remove_volumes: Optional[bool] = None,
        restart: Optional[str] = None,
        rm: Optional[bool] = None,
        security_opts: Optional[Sequence[str]] = None,
        shm_size: Optional[int] = None,
        start: Optional[bool] = None,
        stdin_open: Optional[bool] = None,
        storage_opts: Optional[Mapping[str, Any]] = None,
        sysctls: Optional[Mapping[str, Any]] = None,
        tmpfs: Optional[Mapping[str, Any]] = None,
        tty: Optional[bool] = None,
        ulimits: Optional[Sequence[ContainerUlimitArgs]] = None,
        uploads: Optional[Sequence[ContainerUploadArgs]] = None,
        user: Optional[str] = None,
        userns_mode: Optional[str] = None,
        volumes: Optional[Sequence[ContainerVolumeArgs]] = None,
        working_dir: Optional[str] = None) -> Container
func GetContainer(ctx *Context, name string, id IDInput, state *ContainerState, opts ...ResourceOption) (*Container, error)
public static Container Get(string name, Input<string> id, ContainerState? state, CustomResourceOptions? opts = null)
public static Container get(String name, Output<String> id, ContainerState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Attach bool

If true attach to the container after its creation and waits the end of its execution. Defaults to false.

Bridge string

The network bridge of the container as read from its NetworkSettings.

Capabilities ContainerCapabilitiesArgs

Add or drop certrain linux capabilities.

Command List<string>

The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram","-","baz.con"].

ContainerLogs string

The logs of the container if its execution is done (attach must be disabled).

CpuSet string

A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1.

CpuShares int

CPU shares (relative weight) for the container.

DestroyGraceSeconds int

If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop.

Devices List<ContainerDeviceArgs>

Bind devices to the container.

Dns List<string>

DNS servers to use.

DnsOpts List<string>

DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options.

DnsSearches List<string>

DNS search domains that are used when bare unqualified hostnames are used inside of the container.

Domainname string

Domain name of the container.

Entrypoints List<string>

The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be "/usr/bin/myprogra"].

Envs List<string>

Environment variables to set in the form of KEY=VALUE, e.g. DEBUG=0

ExitCode int

The exit code of the container if its execution is done (must_run must be disabled).

Gateway string

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

GroupAdds List<string>

Additional groups for the container user

Healthcheck ContainerHealthcheckArgs

A test to perform to check that the container is healthy

Hostname string

Hostname of the container.

Hosts List<ContainerHostArgs>

Additional hosts to add to the container.

Image string

The ID of the image to back this container. The easiest way to get this value is to use the docker.RemoteImage resource as is shown in the example.

Init bool

Configured whether an init process should be injected for this container. If unset this will default to the dockerd defaults.

IpAddress string

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

IpPrefixLength int

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

IpcMode string

IPC sharing mode for the container. Possible values are: none, private, shareable, container:<name|id> or host.

Labels List<ContainerLabelArgs>

User-defined key/value metadata

Links List<string>

Set of links for link based connectivity between containers that are running on the same host.

Deprecated:

The --link flag is a legacy feature of Docker. It may eventually be removed.

LogDriver string

The logging driver to use for the container.

LogOpts Dictionary<string, object>

Key/value pairs to use as options for the logging driver.

Logs bool

Save the container logs (attach must be enabled). Defaults to false.

MaxRetryCount int

The maximum amount of times to an attempt a restart when restart is set to 'on-failure'.

Memory int

The memory limit for the container in MBs.

MemorySwap int

The total memory limit (memory + swap) for the container in MBs. This setting may compute to -1 after terraform apply if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.

Mounts List<ContainerMountArgs>

Specification for mounts to be added to containers created as part of the service.

MustRun bool

If true, then the Docker container will be kept running. If false, then as long as the container exists, Terraform assumes it is successful. Defaults to true.

Name string

The name of the container.

NetworkAliases List<string>

Set an alias for the container in all specified networks

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

NetworkDatas List<ContainerNetworkDataArgs>

The data of the networks the container is connected to.

NetworkMode string

Network mode of the container.

Networks List<string>

ID of the networks in which the container is.

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

NetworksAdvanced List<ContainerNetworksAdvancedArgs>

The networks the container is attached to

PidMode string

he PID (Process) Namespace mode for the container. Either container:<name|id> or host.

Ports List<ContainerPortArgs>

Publish a container's port(s) to the host.

Privileged bool

If true, the container runs in privileged mode.

PublishAllPorts bool

Publish all ports of the container.

ReadOnly bool

If true, the container will be started as readonly. Defaults to false.

RemoveVolumes bool

If true, it will remove anonymous volumes associated with the container. Defaults to true.

Restart string

The restart policy for the container. Must be one of 'no', 'on-failure', 'always', 'unless-stopped'. Defaults to no.

Rm bool

If true, then the container will be automatically removed when it exits. Defaults to false.

SecurityOpts List<string>

List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.

ShmSize int

Size of /dev/shm in MBs.

Start bool

If true, then the Docker container will be started after creation. If false, then the container is only created. Defaults to true.

StdinOpen bool

If true, keep STDIN open even if not attached (docker run -i). Defaults to false.

StorageOpts Dictionary<string, object>

Key/value pairs for the storage driver options, e.g. size: 120G

Sysctls Dictionary<string, object>

A map of kernel parameters (sysctls) to set in the container.

Tmpfs Dictionary<string, object>

A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options.

Tty bool

If true, allocate a pseudo-tty (docker run -t). Defaults to false.

Ulimits List<ContainerUlimitArgs>

Ulimit options to add.

Uploads List<ContainerUploadArgs>

Specifies files to upload to the container before starting it. Only one of content or content_base64 can be set and at least one of them has to be set.

User string

User used for run the first process. Format is user or user:group which user and group can be passed literraly or by name.

UsernsMode string

Sets the usernamespace mode for the container when usernamespace remapping option is enabled.

Volumes List<ContainerVolumeArgs>

Spec for mounting volumes in the container.

WorkingDir string

The working directory for commands to run in.

Attach bool

If true attach to the container after its creation and waits the end of its execution. Defaults to false.

Bridge string

The network bridge of the container as read from its NetworkSettings.

Capabilities ContainerCapabilitiesArgs

Add or drop certrain linux capabilities.

Command []string

The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram","-","baz.con"].

ContainerLogs string

The logs of the container if its execution is done (attach must be disabled).

CpuSet string

A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1.

CpuShares int

CPU shares (relative weight) for the container.

DestroyGraceSeconds int

If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop.

Devices []ContainerDeviceArgs

Bind devices to the container.

Dns []string

DNS servers to use.

DnsOpts []string

DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options.

DnsSearches []string

DNS search domains that are used when bare unqualified hostnames are used inside of the container.

Domainname string

Domain name of the container.

Entrypoints []string

The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be "/usr/bin/myprogra"].

Envs []string

Environment variables to set in the form of KEY=VALUE, e.g. DEBUG=0

ExitCode int

The exit code of the container if its execution is done (must_run must be disabled).

Gateway string

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

GroupAdds []string

Additional groups for the container user

Healthcheck ContainerHealthcheckArgs

A test to perform to check that the container is healthy

Hostname string

Hostname of the container.

Hosts []ContainerHostArgs

Additional hosts to add to the container.

Image string

The ID of the image to back this container. The easiest way to get this value is to use the docker.RemoteImage resource as is shown in the example.

Init bool

Configured whether an init process should be injected for this container. If unset this will default to the dockerd defaults.

IpAddress string

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

IpPrefixLength int

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

IpcMode string

IPC sharing mode for the container. Possible values are: none, private, shareable, container:<name|id> or host.

Labels []ContainerLabelArgs

User-defined key/value metadata

Links []string

Set of links for link based connectivity between containers that are running on the same host.

Deprecated:

The --link flag is a legacy feature of Docker. It may eventually be removed.

LogDriver string

The logging driver to use for the container.

LogOpts map[string]interface{}

Key/value pairs to use as options for the logging driver.

Logs bool

Save the container logs (attach must be enabled). Defaults to false.

MaxRetryCount int

The maximum amount of times to an attempt a restart when restart is set to 'on-failure'.

Memory int

The memory limit for the container in MBs.

MemorySwap int

The total memory limit (memory + swap) for the container in MBs. This setting may compute to -1 after terraform apply if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.

Mounts []ContainerMountArgs

Specification for mounts to be added to containers created as part of the service.

MustRun bool

If true, then the Docker container will be kept running. If false, then as long as the container exists, Terraform assumes it is successful. Defaults to true.

Name string

The name of the container.

NetworkAliases []string

Set an alias for the container in all specified networks

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

NetworkDatas []ContainerNetworkDataArgs

The data of the networks the container is connected to.

NetworkMode string

Network mode of the container.

Networks []string

ID of the networks in which the container is.

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

NetworksAdvanced []ContainerNetworksAdvancedArgs

The networks the container is attached to

PidMode string

he PID (Process) Namespace mode for the container. Either container:<name|id> or host.

Ports []ContainerPortArgs

Publish a container's port(s) to the host.

Privileged bool

If true, the container runs in privileged mode.

PublishAllPorts bool

Publish all ports of the container.

ReadOnly bool

If true, the container will be started as readonly. Defaults to false.

RemoveVolumes bool

If true, it will remove anonymous volumes associated with the container. Defaults to true.

Restart string

The restart policy for the container. Must be one of 'no', 'on-failure', 'always', 'unless-stopped'. Defaults to no.

Rm bool

If true, then the container will be automatically removed when it exits. Defaults to false.

SecurityOpts []string

List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.

ShmSize int

Size of /dev/shm in MBs.

Start bool

If true, then the Docker container will be started after creation. If false, then the container is only created. Defaults to true.

StdinOpen bool

If true, keep STDIN open even if not attached (docker run -i). Defaults to false.

StorageOpts map[string]interface{}

Key/value pairs for the storage driver options, e.g. size: 120G

Sysctls map[string]interface{}

A map of kernel parameters (sysctls) to set in the container.

Tmpfs map[string]interface{}

A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options.

Tty bool

If true, allocate a pseudo-tty (docker run -t). Defaults to false.

Ulimits []ContainerUlimitArgs

Ulimit options to add.

Uploads []ContainerUploadArgs

Specifies files to upload to the container before starting it. Only one of content or content_base64 can be set and at least one of them has to be set.

User string

User used for run the first process. Format is user or user:group which user and group can be passed literraly or by name.

UsernsMode string

Sets the usernamespace mode for the container when usernamespace remapping option is enabled.

Volumes []ContainerVolumeArgs

Spec for mounting volumes in the container.

WorkingDir string

The working directory for commands to run in.

attach Boolean

If true attach to the container after its creation and waits the end of its execution. Defaults to false.

bridge String

The network bridge of the container as read from its NetworkSettings.

capabilities ContainerCapabilitiesArgs

Add or drop certrain linux capabilities.

command List

The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram","-","baz.con"].

containerLogs String

The logs of the container if its execution is done (attach must be disabled).

cpuSet String

A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1.

cpuShares Integer

CPU shares (relative weight) for the container.

destroyGraceSeconds Integer

If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop.

devices ListDeviceArgs>

Bind devices to the container.

dns List

DNS servers to use.

dnsOpts List

DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options.

dnsSearches List

DNS search domains that are used when bare unqualified hostnames are used inside of the container.

domainname String

Domain name of the container.

entrypoints List

The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be "/usr/bin/myprogra"].

envs List

Environment variables to set in the form of KEY=VALUE, e.g. DEBUG=0

exitCode Integer

The exit code of the container if its execution is done (must_run must be disabled).

gateway String

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

groupAdds List

Additional groups for the container user

healthcheck ContainerHealthcheckArgs

A test to perform to check that the container is healthy

hostname String

Hostname of the container.

hosts ListHostArgs>

Additional hosts to add to the container.

image String

The ID of the image to back this container. The easiest way to get this value is to use the docker.RemoteImage resource as is shown in the example.

init Boolean

Configured whether an init process should be injected for this container. If unset this will default to the dockerd defaults.

ipAddress String

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

ipPrefixLength Integer

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

ipcMode String

IPC sharing mode for the container. Possible values are: none, private, shareable, container:<name|id> or host.

labels ListLabelArgs>

User-defined key/value metadata

links List

Set of links for link based connectivity between containers that are running on the same host.

Deprecated:

The --link flag is a legacy feature of Docker. It may eventually be removed.

logDriver String

The logging driver to use for the container.

logOpts Map

Key/value pairs to use as options for the logging driver.

logs Boolean

Save the container logs (attach must be enabled). Defaults to false.

maxRetryCount Integer

The maximum amount of times to an attempt a restart when restart is set to 'on-failure'.

memory Integer

The memory limit for the container in MBs.

memorySwap Integer

The total memory limit (memory + swap) for the container in MBs. This setting may compute to -1 after terraform apply if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.

mounts ListMountArgs>

Specification for mounts to be added to containers created as part of the service.

mustRun Boolean

If true, then the Docker container will be kept running. If false, then as long as the container exists, Terraform assumes it is successful. Defaults to true.

name String

The name of the container.

networkAliases List

Set an alias for the container in all specified networks

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

networkDatas ListNetworkDataArgs>

The data of the networks the container is connected to.

networkMode String

Network mode of the container.

networks List

ID of the networks in which the container is.

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

networksAdvanced ListNetworksAdvancedArgs>

The networks the container is attached to

pidMode String

he PID (Process) Namespace mode for the container. Either container:<name|id> or host.

ports ListPortArgs>

Publish a container's port(s) to the host.

privileged Boolean

If true, the container runs in privileged mode.

publishAllPorts Boolean

Publish all ports of the container.

readOnly Boolean

If true, the container will be started as readonly. Defaults to false.

removeVolumes Boolean

If true, it will remove anonymous volumes associated with the container. Defaults to true.

restart String

The restart policy for the container. Must be one of 'no', 'on-failure', 'always', 'unless-stopped'. Defaults to no.

rm Boolean

If true, then the container will be automatically removed when it exits. Defaults to false.

securityOpts List

List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.

shmSize Integer

Size of /dev/shm in MBs.

start Boolean

If true, then the Docker container will be started after creation. If false, then the container is only created. Defaults to true.

stdinOpen Boolean

If true, keep STDIN open even if not attached (docker run -i). Defaults to false.

storageOpts Map

Key/value pairs for the storage driver options, e.g. size: 120G

sysctls Map

A map of kernel parameters (sysctls) to set in the container.

tmpfs Map

A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options.

tty Boolean

If true, allocate a pseudo-tty (docker run -t). Defaults to false.

ulimits ListUlimitArgs>

Ulimit options to add.

uploads ListUploadArgs>

Specifies files to upload to the container before starting it. Only one of content or content_base64 can be set and at least one of them has to be set.

user String

User used for run the first process. Format is user or user:group which user and group can be passed literraly or by name.

usernsMode String

Sets the usernamespace mode for the container when usernamespace remapping option is enabled.

volumes ListVolumeArgs>

Spec for mounting volumes in the container.

workingDir String

The working directory for commands to run in.

attach boolean

If true attach to the container after its creation and waits the end of its execution. Defaults to false.

bridge string

The network bridge of the container as read from its NetworkSettings.

capabilities ContainerCapabilitiesArgs

Add or drop certrain linux capabilities.

command string[]

The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram","-","baz.con"].

containerLogs string

The logs of the container if its execution is done (attach must be disabled).

cpuSet string

A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1.

cpuShares number

CPU shares (relative weight) for the container.

destroyGraceSeconds number

If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop.

devices ContainerDeviceArgs[]

Bind devices to the container.

dns string[]

DNS servers to use.

dnsOpts string[]

DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options.

dnsSearches string[]

DNS search domains that are used when bare unqualified hostnames are used inside of the container.

domainname string

Domain name of the container.

entrypoints string[]

The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be "/usr/bin/myprogra"].

envs string[]

Environment variables to set in the form of KEY=VALUE, e.g. DEBUG=0

exitCode number

The exit code of the container if its execution is done (must_run must be disabled).

gateway string

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

groupAdds string[]

Additional groups for the container user

healthcheck ContainerHealthcheckArgs

A test to perform to check that the container is healthy

hostname string

Hostname of the container.

hosts ContainerHostArgs[]

Additional hosts to add to the container.

image string

The ID of the image to back this container. The easiest way to get this value is to use the docker.RemoteImage resource as is shown in the example.

init boolean

Configured whether an init process should be injected for this container. If unset this will default to the dockerd defaults.

ipAddress string

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

ipPrefixLength number

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

ipcMode string

IPC sharing mode for the container. Possible values are: none, private, shareable, container:<name|id> or host.

labels ContainerLabelArgs[]

User-defined key/value metadata

links string[]

Set of links for link based connectivity between containers that are running on the same host.

Deprecated:

The --link flag is a legacy feature of Docker. It may eventually be removed.

logDriver string

The logging driver to use for the container.

logOpts {[key: string]: any}

Key/value pairs to use as options for the logging driver.

logs boolean

Save the container logs (attach must be enabled). Defaults to false.

maxRetryCount number

The maximum amount of times to an attempt a restart when restart is set to 'on-failure'.

memory number

The memory limit for the container in MBs.

memorySwap number

The total memory limit (memory + swap) for the container in MBs. This setting may compute to -1 after terraform apply if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.

mounts ContainerMountArgs[]

Specification for mounts to be added to containers created as part of the service.

mustRun boolean

If true, then the Docker container will be kept running. If false, then as long as the container exists, Terraform assumes it is successful. Defaults to true.

name string

The name of the container.

networkAliases string[]

Set an alias for the container in all specified networks

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

networkDatas ContainerNetworkDataArgs[]

The data of the networks the container is connected to.

networkMode string

Network mode of the container.

networks string[]

ID of the networks in which the container is.

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

networksAdvanced ContainerNetworksAdvancedArgs[]

The networks the container is attached to

pidMode string

he PID (Process) Namespace mode for the container. Either container:<name|id> or host.

ports ContainerPortArgs[]

Publish a container's port(s) to the host.

privileged boolean

If true, the container runs in privileged mode.

publishAllPorts boolean

Publish all ports of the container.

readOnly boolean

If true, the container will be started as readonly. Defaults to false.

removeVolumes boolean

If true, it will remove anonymous volumes associated with the container. Defaults to true.

restart string

The restart policy for the container. Must be one of 'no', 'on-failure', 'always', 'unless-stopped'. Defaults to no.

rm boolean

If true, then the container will be automatically removed when it exits. Defaults to false.

securityOpts string[]

List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.

shmSize number

Size of /dev/shm in MBs.

start boolean

If true, then the Docker container will be started after creation. If false, then the container is only created. Defaults to true.

stdinOpen boolean

If true, keep STDIN open even if not attached (docker run -i). Defaults to false.

storageOpts {[key: string]: any}

Key/value pairs for the storage driver options, e.g. size: 120G

sysctls {[key: string]: any}

A map of kernel parameters (sysctls) to set in the container.

tmpfs {[key: string]: any}

A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options.

tty boolean

If true, allocate a pseudo-tty (docker run -t). Defaults to false.

ulimits ContainerUlimitArgs[]

Ulimit options to add.

uploads ContainerUploadArgs[]

Specifies files to upload to the container before starting it. Only one of content or content_base64 can be set and at least one of them has to be set.

user string

User used for run the first process. Format is user or user:group which user and group can be passed literraly or by name.

usernsMode string

Sets the usernamespace mode for the container when usernamespace remapping option is enabled.

volumes ContainerVolumeArgs[]

Spec for mounting volumes in the container.

workingDir string

The working directory for commands to run in.

attach bool

If true attach to the container after its creation and waits the end of its execution. Defaults to false.

bridge str

The network bridge of the container as read from its NetworkSettings.

capabilities ContainerCapabilitiesArgs

Add or drop certrain linux capabilities.

command Sequence[str]

The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram","-","baz.con"].

container_logs str

The logs of the container if its execution is done (attach must be disabled).

cpu_set str

A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1.

cpu_shares int

CPU shares (relative weight) for the container.

destroy_grace_seconds int

If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop.

devices Sequence[ContainerDeviceArgs]

Bind devices to the container.

dns Sequence[str]

DNS servers to use.

dns_opts Sequence[str]

DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options.

dns_searches Sequence[str]

DNS search domains that are used when bare unqualified hostnames are used inside of the container.

domainname str

Domain name of the container.

entrypoints Sequence[str]

The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be "/usr/bin/myprogra"].

envs Sequence[str]

Environment variables to set in the form of KEY=VALUE, e.g. DEBUG=0

exit_code int

The exit code of the container if its execution is done (must_run must be disabled).

gateway str

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

group_adds Sequence[str]

Additional groups for the container user

healthcheck ContainerHealthcheckArgs

A test to perform to check that the container is healthy

hostname str

Hostname of the container.

hosts Sequence[ContainerHostArgs]

Additional hosts to add to the container.

image str

The ID of the image to back this container. The easiest way to get this value is to use the docker.RemoteImage resource as is shown in the example.

init bool

Configured whether an init process should be injected for this container. If unset this will default to the dockerd defaults.

ip_address str

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

ip_prefix_length int

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

ipc_mode str

IPC sharing mode for the container. Possible values are: none, private, shareable, container:<name|id> or host.

labels Sequence[ContainerLabelArgs]

User-defined key/value metadata

links Sequence[str]

Set of links for link based connectivity between containers that are running on the same host.

Deprecated:

The --link flag is a legacy feature of Docker. It may eventually be removed.

log_driver str

The logging driver to use for the container.

log_opts Mapping[str, Any]

Key/value pairs to use as options for the logging driver.

logs bool

Save the container logs (attach must be enabled). Defaults to false.

max_retry_count int

The maximum amount of times to an attempt a restart when restart is set to 'on-failure'.

memory int

The memory limit for the container in MBs.

memory_swap int

The total memory limit (memory + swap) for the container in MBs. This setting may compute to -1 after terraform apply if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.

mounts Sequence[ContainerMountArgs]

Specification for mounts to be added to containers created as part of the service.

must_run bool

If true, then the Docker container will be kept running. If false, then as long as the container exists, Terraform assumes it is successful. Defaults to true.

name str

The name of the container.

network_aliases Sequence[str]

Set an alias for the container in all specified networks

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

network_datas Sequence[ContainerNetworkDataArgs]

The data of the networks the container is connected to.

network_mode str

Network mode of the container.

networks Sequence[str]

ID of the networks in which the container is.

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

networks_advanced Sequence[ContainerNetworksAdvancedArgs]

The networks the container is attached to

pid_mode str

he PID (Process) Namespace mode for the container. Either container:<name|id> or host.

ports Sequence[ContainerPortArgs]

Publish a container's port(s) to the host.

privileged bool

If true, the container runs in privileged mode.

publish_all_ports bool

Publish all ports of the container.

read_only bool

If true, the container will be started as readonly. Defaults to false.

remove_volumes bool

If true, it will remove anonymous volumes associated with the container. Defaults to true.

restart str

The restart policy for the container. Must be one of 'no', 'on-failure', 'always', 'unless-stopped'. Defaults to no.

rm bool

If true, then the container will be automatically removed when it exits. Defaults to false.

security_opts Sequence[str]

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 int

Size of /dev/shm in MBs.

start bool

If true, then the Docker container will be started after creation. If false, then the container is only created. Defaults to true.

stdin_open bool

If true, keep STDIN open even if not attached (docker run -i). Defaults to false.

storage_opts Mapping[str, Any]

Key/value pairs for the storage driver options, e.g. size: 120G

sysctls Mapping[str, Any]

A map of kernel parameters (sysctls) to set in the container.

tmpfs Mapping[str, Any]

A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options.

tty bool

If true, allocate a pseudo-tty (docker run -t). Defaults to false.

ulimits Sequence[ContainerUlimitArgs]

Ulimit options to add.

uploads Sequence[ContainerUploadArgs]

Specifies files to upload to the container before starting it. Only one of content or content_base64 can be set and at least one of them has to be set.

user str

User used for run the first process. Format is user or user:group which user and group can be passed literraly or by name.

userns_mode str

Sets the usernamespace mode for the container when usernamespace remapping option is enabled.

volumes Sequence[ContainerVolumeArgs]

Spec for mounting volumes in the container.

working_dir str

The working directory for commands to run in.

attach Boolean

If true attach to the container after its creation and waits the end of its execution. Defaults to false.

bridge String

The network bridge of the container as read from its NetworkSettings.

capabilities Property Map

Add or drop certrain linux capabilities.

command List

The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram","-","baz.con"].

containerLogs String

The logs of the container if its execution is done (attach must be disabled).

cpuSet String

A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1.

cpuShares Number

CPU shares (relative weight) for the container.

destroyGraceSeconds Number

If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop.

devices List

Bind devices to the container.

dns List

DNS servers to use.

dnsOpts List

DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options.

dnsSearches List

DNS search domains that are used when bare unqualified hostnames are used inside of the container.

domainname String

Domain name of the container.

entrypoints List

The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be "/usr/bin/myprogra"].

envs List

Environment variables to set in the form of KEY=VALUE, e.g. DEBUG=0

exitCode Number

The exit code of the container if its execution is done (must_run must be disabled).

gateway String

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

groupAdds List

Additional groups for the container user

healthcheck Property Map

A test to perform to check that the container is healthy

hostname String

Hostname of the container.

hosts List

Additional hosts to add to the container.

image String

The ID of the image to back this container. The easiest way to get this value is to use the docker.RemoteImage resource as is shown in the example.

init Boolean

Configured whether an init process should be injected for this container. If unset this will default to the dockerd defaults.

ipAddress String

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

ipPrefixLength Number

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

ipcMode String

IPC sharing mode for the container. Possible values are: none, private, shareable, container:<name|id> or host.

labels List

User-defined key/value metadata

links List

Set of links for link based connectivity between containers that are running on the same host.

Deprecated:

The --link flag is a legacy feature of Docker. It may eventually be removed.

logDriver String

The logging driver to use for the container.

logOpts Map

Key/value pairs to use as options for the logging driver.

logs Boolean

Save the container logs (attach must be enabled). Defaults to false.

maxRetryCount Number

The maximum amount of times to an attempt a restart when restart is set to 'on-failure'.

memory Number

The memory limit for the container in MBs.

memorySwap Number

The total memory limit (memory + swap) for the container in MBs. This setting may compute to -1 after terraform apply if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.

mounts List

Specification for mounts to be added to containers created as part of the service.

mustRun Boolean

If true, then the Docker container will be kept running. If false, then as long as the container exists, Terraform assumes it is successful. Defaults to true.

name String

The name of the container.

networkAliases List

Set an alias for the container in all specified networks

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

networkDatas List

The data of the networks the container is connected to.

networkMode String

Network mode of the container.

networks List

ID of the networks in which the container is.

Deprecated:

Use networks_advanced instead. Will be removed in v3.0.0

networksAdvanced List

The networks the container is attached to

pidMode String

he PID (Process) Namespace mode for the container. Either container:<name|id> or host.

ports List

Publish a container's port(s) to the host.

privileged Boolean

If true, the container runs in privileged mode.

publishAllPorts Boolean

Publish all ports of the container.

readOnly Boolean

If true, the container will be started as readonly. Defaults to false.

removeVolumes Boolean

If true, it will remove anonymous volumes associated with the container. Defaults to true.

restart String

The restart policy for the container. Must be one of 'no', 'on-failure', 'always', 'unless-stopped'. Defaults to no.

rm Boolean

If true, then the container will be automatically removed when it exits. Defaults to false.

securityOpts List

List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.

shmSize Number

Size of /dev/shm in MBs.

start Boolean

If true, then the Docker container will be started after creation. If false, then the container is only created. Defaults to true.

stdinOpen Boolean

If true, keep STDIN open even if not attached (docker run -i). Defaults to false.

storageOpts Map

Key/value pairs for the storage driver options, e.g. size: 120G

sysctls Map

A map of kernel parameters (sysctls) to set in the container.

tmpfs Map

A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options.

tty Boolean

If true, allocate a pseudo-tty (docker run -t). Defaults to false.

ulimits List

Ulimit options to add.

uploads List

Specifies files to upload to the container before starting it. Only one of content or content_base64 can be set and at least one of them has to be set.

user String

User used for run the first process. Format is user or user:group which user and group can be passed literraly or by name.

usernsMode String

Sets the usernamespace mode for the container when usernamespace remapping option is enabled.

volumes List

Spec for mounting volumes in the container.

workingDir String

The working directory for commands to run in.

Supporting Types

ContainerCapabilities

Adds List<string>

List of linux capabilities to add.

Drops List<string>

List of linux capabilities to drop.

Adds []string

List of linux capabilities to add.

Drops []string

List of linux capabilities to drop.

adds List

List of linux capabilities to add.

drops List

List of linux capabilities to drop.

adds string[]

List of linux capabilities to add.

drops string[]

List of linux capabilities to drop.

adds Sequence[str]

List of linux capabilities to add.

drops Sequence[str]

List of linux capabilities to drop.

adds List

List of linux capabilities to add.

drops List

List of linux capabilities to drop.

ContainerDevice

HostPath string

The path on the host where the device is located.

ContainerPath string

The path in the container where the device will be bound.

Permissions string

The cgroup permissions given to the container to access the device. Defaults to rwm.

HostPath string

The path on the host where the device is located.

ContainerPath string

The path in the container where the device will be bound.

Permissions string

The cgroup permissions given to the container to access the device. Defaults to rwm.

hostPath String

The path on the host where the device is located.

containerPath String

The path in the container where the device will be bound.

permissions String

The cgroup permissions given to the container to access the device. Defaults to rwm.

hostPath string

The path on the host where the device is located.

containerPath string

The path in the container where the device will be bound.

permissions string

The cgroup permissions given to the container to access the device. Defaults to rwm.

host_path str

The path on the host where the device is located.

container_path str

The path in the container where the device will be bound.

permissions str

The cgroup permissions given to the container to access the device. Defaults to rwm.

hostPath String

The path on the host where the device is located.

containerPath String

The path in the container where the device will be bound.

permissions String

The cgroup permissions given to the container to access the device. Defaults to rwm.

ContainerHealthcheck

Tests List<string>

Command to run to check health. For example, to run curl -f localhost/health set the command to be ["CMD", "curl", "-f", "localhost/health"].

Interval string

Time between running the check (ms|s|m|h). Defaults to 0s.

Retries int

Consecutive failures needed to report unhealthy. Defaults to 0.

StartPeriod string

Start period for the container to initialize before counting retries towards unstable (ms|s|m|h). Defaults to 0s.

Timeout string

Maximum time to allow one check to run (ms|s|m|h). Defaults to 0s.

Tests []string

Command to run to check health. For example, to run curl -f localhost/health set the command to be ["CMD", "curl", "-f", "localhost/health"].

Interval string

Time between running the check (ms|s|m|h). Defaults to 0s.

Retries int

Consecutive failures needed to report unhealthy. Defaults to 0.

StartPeriod string

Start period for the container to initialize before counting retries towards unstable (ms|s|m|h). Defaults to 0s.

Timeout string

Maximum time to allow one check to run (ms|s|m|h). Defaults to 0s.

tests List

Command to run to check health. For example, to run curl -f localhost/health set the command to be ["CMD", "curl", "-f", "localhost/health"].

interval String

Time between running the check (ms|s|m|h). Defaults to 0s.

retries Integer

Consecutive failures needed to report unhealthy. Defaults to 0.

startPeriod String

Start period for the container to initialize before counting retries towards unstable (ms|s|m|h). Defaults to 0s.

timeout String

Maximum time to allow one check to run (ms|s|m|h). Defaults to 0s.

tests string[]

Command to run to check health. For example, to run curl -f localhost/health set the command to be ["CMD", "curl", "-f", "localhost/health"].

interval string

Time between running the check (ms|s|m|h). Defaults to 0s.

retries number

Consecutive failures needed to report unhealthy. Defaults to 0.

startPeriod string

Start period for the container to initialize before counting retries towards unstable (ms|s|m|h). Defaults to 0s.

timeout string

Maximum time to allow one check to run (ms|s|m|h). Defaults to 0s.

tests Sequence[str]

Command to run to check health. For example, to run curl -f localhost/health set the command to be ["CMD", "curl", "-f", "localhost/health"].

interval str

Time between running the check (ms|s|m|h). Defaults to 0s.

retries int

Consecutive failures needed to report unhealthy. Defaults to 0.

start_period str

Start period for the container to initialize before counting retries towards unstable (ms|s|m|h). Defaults to 0s.

timeout str

Maximum time to allow one check to run (ms|s|m|h). Defaults to 0s.

tests List

Command to run to check health. For example, to run curl -f localhost/health set the command to be ["CMD", "curl", "-f", "localhost/health"].

interval String

Time between running the check (ms|s|m|h). Defaults to 0s.

retries Number

Consecutive failures needed to report unhealthy. Defaults to 0.

startPeriod String

Start period for the container to initialize before counting retries towards unstable (ms|s|m|h). Defaults to 0s.

timeout String

Maximum time to allow one check to run (ms|s|m|h). Defaults to 0s.

ContainerHost

Host string

Hostname to add

Ip string

IP address this hostname should resolve to.

Host string

Hostname to add

Ip string

IP address this hostname should resolve to.

host String

Hostname to add

ip String

IP address this hostname should resolve to.

host string

Hostname to add

ip string

IP address this hostname should resolve to.

host str

Hostname to add

ip str

IP address this hostname should resolve to.

host String

Hostname to add

ip String

IP address this hostname should resolve to.

ContainerLabel

Label string

Name of the label

Value string

Value of the label

Label string

Name of the label

Value string

Value of the label

label String

Name of the label

value String

Value of the label

label string

Name of the label

value string

Value of the label

label str

Name of the label

value str

Value of the label

label String

Name of the label

value String

Value of the label

ContainerMount

Target string

Container path

Type string

The mount type

BindOptions ContainerMountBindOptions

Optional configuration for the bind type.

ReadOnly bool

Whether the mount should be read-only.

Source string

Mount source (e.g. a volume name, a host path).

TmpfsOptions ContainerMountTmpfsOptions

Optional configuration for the tmpfs type.

VolumeOptions ContainerMountVolumeOptions

Optional configuration for the volume type.

Target string

Container path

Type string

The mount type

BindOptions ContainerMountBindOptions

Optional configuration for the bind type.

ReadOnly bool

Whether the mount should be read-only.

Source string

Mount source (e.g. a volume name, a host path).

TmpfsOptions ContainerMountTmpfsOptions

Optional configuration for the tmpfs type.

VolumeOptions ContainerMountVolumeOptions

Optional configuration for the volume type.

target String

Container path

type String

The mount type

bindOptions ContainerMountBindOptions

Optional configuration for the bind type.

readOnly Boolean

Whether the mount should be read-only.

source String

Mount source (e.g. a volume name, a host path).

tmpfsOptions ContainerMountTmpfsOptions

Optional configuration for the tmpfs type.

volumeOptions ContainerMountVolumeOptions

Optional configuration for the volume type.

target string

Container path

type string

The mount type

bindOptions ContainerMountBindOptions

Optional configuration for the bind type.

readOnly boolean

Whether the mount should be read-only.

source string

Mount source (e.g. a volume name, a host path).

tmpfsOptions ContainerMountTmpfsOptions

Optional configuration for the tmpfs type.

volumeOptions ContainerMountVolumeOptions

Optional configuration for the volume type.

target str

Container path

type str

The mount type

bind_options ContainerMountBindOptions

Optional configuration for the bind type.

read_only bool

Whether the mount should be read-only.

source str

Mount source (e.g. a volume name, a host path).

tmpfs_options ContainerMountTmpfsOptions

Optional configuration for the tmpfs type.

volume_options ContainerMountVolumeOptions

Optional configuration for the volume type.

target String

Container path

type String

The mount type

bindOptions Property Map

Optional configuration for the bind type.

readOnly Boolean

Whether the mount should be read-only.

source String

Mount source (e.g. a volume name, a host path).

tmpfsOptions Property Map

Optional configuration for the tmpfs type.

volumeOptions Property Map

Optional configuration for the volume type.

ContainerMountBindOptions

ContainerMountTmpfsOptions

mode Integer
sizeBytes Integer
mode number
sizeBytes number
mode Number
sizeBytes Number

ContainerMountVolumeOptions

DriverName string
DriverOptions Dictionary<string, string>
Labels List<ContainerMountVolumeOptionsLabel>

User-defined key/value metadata

NoCopy bool
DriverName string
DriverOptions map[string]string
Labels []ContainerMountVolumeOptionsLabel

User-defined key/value metadata

NoCopy bool
driverName String
driverOptions Map
labels ListMountVolumeOptionsLabel>

User-defined key/value metadata

noCopy Boolean
driverName string
driverOptions {[key: string]: string}
labels ContainerMountVolumeOptionsLabel[]

User-defined key/value metadata

noCopy boolean
driver_name str
driver_options Mapping[str, str]
labels Sequence[ContainerMountVolumeOptionsLabel]

User-defined key/value metadata

no_copy bool
driverName String
driverOptions Map
labels List

User-defined key/value metadata

noCopy Boolean

ContainerMountVolumeOptionsLabel

Label string

Name of the label

Value string

Value of the label

Label string

Name of the label

Value string

Value of the label

label String

Name of the label

value String

Value of the label

label string

Name of the label

value string

Value of the label

label str

Name of the label

value str

Value of the label

label String

Name of the label

value String

Value of the label

ContainerNetworkData

Gateway string

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

GlobalIpv6Address string
GlobalIpv6PrefixLength int
IpAddress string

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

IpPrefixLength int

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

Ipv6Gateway string
NetworkName string
Gateway string

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

GlobalIpv6Address string
GlobalIpv6PrefixLength int
IpAddress string

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

IpPrefixLength int

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

Ipv6Gateway string
NetworkName string
gateway String

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

globalIpv6Address String
globalIpv6PrefixLength Integer
ipAddress String

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

ipPrefixLength Integer

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

ipv6Gateway String
networkName String
gateway string

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

globalIpv6Address string
globalIpv6PrefixLength number
ipAddress string

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

ipPrefixLength number

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

ipv6Gateway string
networkName string
gateway str

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

global_ipv6_address str
global_ipv6_prefix_length int
ip_address str

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

ip_prefix_length int

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

ipv6_gateway str
network_name str
gateway String

The network gateway of the container.

Deprecated:

Use network_data instead. The network gateway of the container as read from its NetworkSettings.

globalIpv6Address String
globalIpv6PrefixLength Number
ipAddress String

The IP address of the container.

Deprecated:

Use network_data instead. The IP address of the container's first network it.

ipPrefixLength Number

The IP prefix length of the container.

Deprecated:

Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

ipv6Gateway String
networkName String

ContainerNetworksAdvanced

Name string

The name of the network.

Aliases List<string>

The network aliases of the container in the specific network.

Ipv4Address string

The IPV4 address of the container in the specific network.

Ipv6Address string

The IPV6 address of the container in the specific network.

Name string

The name of the network.

Aliases []string

The network aliases of the container in the specific network.

Ipv4Address string

The IPV4 address of the container in the specific network.

Ipv6Address string

The IPV6 address of the container in the specific network.

name String

The name of the network.

aliases List

The network aliases of the container in the specific network.

ipv4Address String

The IPV4 address of the container in the specific network.

ipv6Address String

The IPV6 address of the container in the specific network.

name string

The name of the network.

aliases string[]

The network aliases of the container in the specific network.

ipv4Address string

The IPV4 address of the container in the specific network.

ipv6Address string

The IPV6 address of the container in the specific network.

name str

The name of the network.

aliases Sequence[str]

The network aliases of the container in the specific network.

ipv4_address str

The IPV4 address of the container in the specific network.

ipv6_address str

The IPV6 address of the container in the specific network.

name String

The name of the network.

aliases List

The network aliases of the container in the specific network.

ipv4Address String

The IPV4 address of the container in the specific network.

ipv6Address String

The IPV6 address of the container in the specific network.

ContainerPort

Internal int

Port within the container.

External int

Port exposed out of the container. If not given a free random port >= 32768 will be used.

Ip string

IP address/mask that can access this port. Defaults to 0.0.0.0.

Protocol string

Protocol that can be used over this port. Defaults to tcp.

Internal int

Port within the container.

External int

Port exposed out of the container. If not given a free random port >= 32768 will be used.

Ip string

IP address/mask that can access this port. Defaults to 0.0.0.0.

Protocol string

Protocol that can be used over this port. Defaults to tcp.

internal Integer

Port within the container.

external Integer

Port exposed out of the container. If not given a free random port >= 32768 will be used.

ip String

IP address/mask that can access this port. Defaults to 0.0.0.0.

protocol String

Protocol that can be used over this port. Defaults to tcp.

internal number

Port within the container.

external number

Port exposed out of the container. If not given a free random port >= 32768 will be used.

ip string

IP address/mask that can access this port. Defaults to 0.0.0.0.

protocol string

Protocol that can be used over this port. Defaults to tcp.

internal int

Port within the container.

external int

Port exposed out of the container. If not given a free random port >= 32768 will be used.

ip str

IP address/mask that can access this port. Defaults to 0.0.0.0.

protocol str

Protocol that can be used over this port. Defaults to tcp.

internal Number

Port within the container.

external Number

Port exposed out of the container. If not given a free random port >= 32768 will be used.

ip String

IP address/mask that can access this port. Defaults to 0.0.0.0.

protocol String

Protocol that can be used over this port. Defaults to tcp.

ContainerUlimit

Hard int

The hard limit

Name string

The name of the ulimit

Soft int

The soft limit

Hard int

The hard limit

Name string

The name of the ulimit

Soft int

The soft limit

hard Integer

The hard limit

name String

The name of the ulimit

soft Integer

The soft limit

hard number

The hard limit

name string

The name of the ulimit

soft number

The soft limit

hard int

The hard limit

name str

The name of the ulimit

soft int

The soft limit

hard Number

The hard limit

name String

The name of the ulimit

soft Number

The soft limit

ContainerUpload

File string

Path to the file in the container where is upload goes to

Content string

Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text. Conflicts with content_base64 & source

ContentBase64 string
Executable bool

If true, the file will be uploaded with user executable permission. Defaults to false.

Source string

A filename that references a file which will be uploaded as the object content. This allows for large file uploads that do not get stored in state. Conflicts with content & content_base64

SourceHash string

If using source, this will force an update if the file content has updated but the filename has not.

File string

Path to the file in the container where is upload goes to

Content string

Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text. Conflicts with content_base64 & source

ContentBase64 string
Executable bool

If true, the file will be uploaded with user executable permission. Defaults to false.

Source string

A filename that references a file which will be uploaded as the object content. This allows for large file uploads that do not get stored in state. Conflicts with content & content_base64

SourceHash string

If using source, this will force an update if the file content has updated but the filename has not.

file String

Path to the file in the container where is upload goes to

content String

Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text. Conflicts with content_base64 & source

contentBase64 String
executable Boolean

If true, the file will be uploaded with user executable permission. Defaults to false.

source String

A filename that references a file which will be uploaded as the object content. This allows for large file uploads that do not get stored in state. Conflicts with content & content_base64

sourceHash String

If using source, this will force an update if the file content has updated but the filename has not.

file string

Path to the file in the container where is upload goes to

content string

Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text. Conflicts with content_base64 & source

contentBase64 string
executable boolean

If true, the file will be uploaded with user executable permission. Defaults to false.

source string

A filename that references a file which will be uploaded as the object content. This allows for large file uploads that do not get stored in state. Conflicts with content & content_base64

sourceHash string

If using source, this will force an update if the file content has updated but the filename has not.

file str

Path to the file in the container where is upload goes to

content str

Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text. Conflicts with content_base64 & source

content_base64 str
executable bool

If true, the file will be uploaded with user executable permission. Defaults to false.

source str

A filename that references a file which will be uploaded as the object content. This allows for large file uploads that do not get stored in state. Conflicts with content & content_base64

source_hash str

If using source, this will force an update if the file content has updated but the filename has not.

file String

Path to the file in the container where is upload goes to

content String

Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text. Conflicts with content_base64 & source

contentBase64 String
executable Boolean

If true, the file will be uploaded with user executable permission. Defaults to false.

source String

A filename that references a file which will be uploaded as the object content. This allows for large file uploads that do not get stored in state. Conflicts with content & content_base64

sourceHash String

If using source, this will force an update if the file content has updated but the filename has not.

ContainerVolume

ContainerPath string

The path in the container where the volume will be mounted.

FromContainer string

The container where the volume is coming from.

HostPath string

The path on the host where the volume is coming from.

ReadOnly bool

If true, this volume will be readonly. Defaults to false.

VolumeName string

The name of the docker volume which should be mounted.

ContainerPath string

The path in the container where the volume will be mounted.

FromContainer string

The container where the volume is coming from.

HostPath string

The path on the host where the volume is coming from.

ReadOnly bool

If true, this volume will be readonly. Defaults to false.

VolumeName string

The name of the docker volume which should be mounted.

containerPath String

The path in the container where the volume will be mounted.

fromContainer String

The container where the volume is coming from.

hostPath String

The path on the host where the volume is coming from.

readOnly Boolean

If true, this volume will be readonly. Defaults to false.

volumeName String

The name of the docker volume which should be mounted.

containerPath string

The path in the container where the volume will be mounted.

fromContainer string

The container where the volume is coming from.

hostPath string

The path on the host where the volume is coming from.

readOnly boolean

If true, this volume will be readonly. Defaults to false.

volumeName string

The name of the docker volume which should be mounted.

container_path str

The path in the container where the volume will be mounted.

from_container str

The container where the volume is coming from.

host_path str

The path on the host where the volume is coming from.

read_only bool

If true, this volume will be readonly. Defaults to false.

volume_name str

The name of the docker volume which should be mounted.

containerPath String

The path in the container where the volume will be mounted.

fromContainer String

The container where the volume is coming from.

hostPath String

The path on the host where the volume is coming from.

readOnly Boolean

If true, this volume will be readonly. Defaults to false.

volumeName String

The name of the docker volume which should be mounted.

Import

Example Assuming you created a container as follows #!/bin/bash docker run –name foo -p8080:80 -d nginx

prints the container ID

9a550c0f0163d39d77222d3efd58701b625d47676c25c686c95b5b92d1cba6fd you provide the definition for the resource as follows terraform resource “docker_container” “foo” {

name

= “foo”

image = “nginx”

ports {

internal = “80”

external = “8080”

} } then the import command is as follows #!/bin/bash

 $ pulumi import docker:index/container:Container foo 9a550c0f0163d39d77222d3efd58701b625d47676c25c686c95b5b92d1cba6fd

Package Details

Repository
https://github.com/pulumi/pulumi-docker
License
Apache-2.0
Notes

This Pulumi package is based on the docker Terraform Provider.