Docker v4.2.4, Jun 2 23
Docker v4.2.4, Jun 2 23
docker.Container
Explore with Pulumi AI
Manages the lifecycle of a Docker container.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Docker = Pulumi.Docker;
return await Deployment.RunAsync(() =>
{
// Find the latest Ubuntu precise image.
var ubuntuRemoteImage = new Docker.RemoteImage("ubuntuRemoteImage", new()
{
Name = "ubuntu:precise",
});
// Start a container
var ubuntuContainer = new Docker.Container("ubuntuContainer", new()
{
Image = ubuntuRemoteImage.ImageId,
});
});
package main
import (
"github.com/pulumi/pulumi-docker/sdk/v4/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.ImageId,
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.docker.RemoteImage;
import com.pulumi.docker.RemoteImageArgs;
import com.pulumi.docker.Container;
import com.pulumi.docker.ContainerArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var ubuntuRemoteImage = new RemoteImage("ubuntuRemoteImage", RemoteImageArgs.builder()
.name("ubuntu:precise")
.build());
var ubuntuContainer = new Container("ubuntuContainer", ContainerArgs.builder()
.image(ubuntuRemoteImage.imageId())
.build());
}
}
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.image_id)
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.imageId});
resources:
# Start a container
ubuntuContainer:
type: docker:Container
properties:
image: ${ubuntuRemoteImage.imageId}
# Find the latest Ubuntu precise image.
ubuntuRemoteImage:
type: docker:RemoteImage
properties:
name: ubuntu:precise
Create 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,
cgroupns_mode: Optional[str] = None,
command: Optional[Sequence[str]] = None,
container_read_refresh_timeout_milliseconds: Optional[int] = 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,
gpus: 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,
ipc_mode: Optional[str] = None,
labels: Optional[Sequence[ContainerLabelArgs]] = 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_mode: Optional[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,
runtime: Optional[str] = None,
security_opts: Optional[Sequence[str]] = None,
shm_size: Optional[int] = None,
start: Optional[bool] = None,
stdin_open: Optional[bool] = None,
stop_signal: Optional[str] = None,
stop_timeout: Optional[int] = 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,
wait: Optional[bool] = None,
wait_timeout: Optional[int] = 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 tofalse
.- Capabilities
Container
Capabilities Args Add or drop certrain linux capabilities.
- Cgroupns
Mode string Cgroup namespace mode to use for the container. Possible values are:
private
,host
.- 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","-f","baz.con"]
.- Container
Read intRefresh Timeout Milliseconds The total number of milliseconds to wait for the container to reach status 'running'
- Cpu
Set string A comma-separated list or hyphen-separated range of CPUs a container can use, e.g.
0-1
.- int
CPU shares (relative weight) for the container.
- Destroy
Grace intSeconds If defined will attempt to stop the container before destroying. Container will be destroyed after
n
seconds or on successful stop.- Devices
List<Container
Device Args> Bind devices to the container.
- Dns List<string>
DNS servers to use.
- Dns
Opts List<string> DNS options used by the DNS provider(s), see
resolv.conf
documentation for valid list of options.- Dns
Searches 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
- Gpus string
GPU devices to add to the container. Currently, only the value
all
is supported. Passing any other value will result in unexpected behavior.- Group
Adds List<string> Additional groups for the container user
- Healthcheck
Container
Healthcheck Args A test to perform to check that the container is healthy
- Hostname string
Hostname of the container.
- Hosts
List<Container
Host Args> 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 string IPC sharing mode for the container. Possible values are:
none
,private
,shareable
,container:<name|id>
orhost
.- Labels
List<Container
Label Args> User-defined key/value metadata
- Log
Driver string The logging driver to use for the container.
- Log
Opts 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 tofalse
.- Max
Retry intCount 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
afterpulumi up
if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.- Mounts
List<Container
Mount Args> 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. Iffalse
, then as long as the container exists, Terraform assumes it is successful. Defaults totrue
.- Name string
The name of the container.
- Network
Mode string Network mode of the container.
- Networks
Advanced List<ContainerNetworks Advanced Args> The networks the container is attached to
- Pid
Mode string he PID (Process) Namespace mode for the container. Either
container:<name|id>
orhost
.- Ports
List<Container
Port Args> Publish a container's port(s) to the host.
- Privileged bool
If
true
, the container runs in privileged mode.- Publish
All boolPorts Publish all ports of the container.
- Read
Only bool If
true
, the container will be started as readonly. Defaults tofalse
.- Remove
Volumes bool If
true
, it will remove anonymous volumes associated with the container. Defaults totrue
.- 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 tofalse
.- Runtime string
Runtime to use for the container.
- Security
Opts 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.
- Shm
Size int Size of
/dev/shm
in MBs.- Start bool
If
true
, then the Docker container will be started after creation. Iffalse
, then the container is only created. Defaults totrue
.- Stdin
Open bool If
true
, keep STDIN open even if not attached (docker run -i
). Defaults tofalse
.- Stop
Signal string Signal to stop a container (default
SIGTERM
).- Stop
Timeout int Timeout (in seconds) to stop a container.
- Storage
Opts 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 tofalse
.- Ulimits
List<Container
Ulimit Args> Ulimit options to add.
- Uploads
List<Container
Upload Args> Specifies files to upload to the container before starting it. Only one of
content
orcontent_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
oruser:group
which user and group can be passed literraly or by name.- Userns
Mode string Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
- Volumes
List<Container
Volume Args> Spec for mounting volumes in the container.
- Wait bool
If
true
, then the Docker container is waited for being healthy state after creation. Iffalse
, then the container health state is not checked. Defaults tofalse
.- Wait
Timeout int The timeout in seconds to wait the container to be healthy after creation. Defaults to
60
.- Working
Dir 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 tofalse
.- Capabilities
Container
Capabilities Args Add or drop certrain linux capabilities.
- Cgroupns
Mode string Cgroup namespace mode to use for the container. Possible values are:
private
,host
.- 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","-f","baz.con"]
.- Container
Read intRefresh Timeout Milliseconds The total number of milliseconds to wait for the container to reach status 'running'
- Cpu
Set string A comma-separated list or hyphen-separated range of CPUs a container can use, e.g.
0-1
.- int
CPU shares (relative weight) for the container.
- Destroy
Grace intSeconds If defined will attempt to stop the container before destroying. Container will be destroyed after
n
seconds or on successful stop.- Devices
[]Container
Device Args Bind devices to the container.
- Dns []string
DNS servers to use.
- Dns
Opts []string DNS options used by the DNS provider(s), see
resolv.conf
documentation for valid list of options.- Dns
Searches []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
- Gpus string
GPU devices to add to the container. Currently, only the value
all
is supported. Passing any other value will result in unexpected behavior.- Group
Adds []string Additional groups for the container user
- Healthcheck
Container
Healthcheck Args A test to perform to check that the container is healthy
- Hostname string
Hostname of the container.
- Hosts
[]Container
Host Args 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 string IPC sharing mode for the container. Possible values are:
none
,private
,shareable
,container:<name|id>
orhost
.- Labels
[]Container
Label Args User-defined key/value metadata
- Log
Driver string The logging driver to use for the container.
- Log
Opts 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 tofalse
.- Max
Retry intCount 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
afterpulumi up
if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.- Mounts
[]Container
Mount Args 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. Iffalse
, then as long as the container exists, Terraform assumes it is successful. Defaults totrue
.- Name string
The name of the container.
- Network
Mode string Network mode of the container.
- Networks
Advanced []ContainerNetworks Advanced Args The networks the container is attached to
- Pid
Mode string he PID (Process) Namespace mode for the container. Either
container:<name|id>
orhost
.- Ports
[]Container
Port Args Publish a container's port(s) to the host.
- Privileged bool
If
true
, the container runs in privileged mode.- Publish
All boolPorts Publish all ports of the container.
- Read
Only bool If
true
, the container will be started as readonly. Defaults tofalse
.- Remove
Volumes bool If
true
, it will remove anonymous volumes associated with the container. Defaults totrue
.- 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 tofalse
.- Runtime string
Runtime to use for the container.
- Security
Opts []string List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.
- Shm
Size int Size of
/dev/shm
in MBs.- Start bool
If
true
, then the Docker container will be started after creation. Iffalse
, then the container is only created. Defaults totrue
.- Stdin
Open bool If
true
, keep STDIN open even if not attached (docker run -i
). Defaults tofalse
.- Stop
Signal string Signal to stop a container (default
SIGTERM
).- Stop
Timeout int Timeout (in seconds) to stop a container.
- Storage
Opts 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 tofalse
.- Ulimits
[]Container
Ulimit Args Ulimit options to add.
- Uploads
[]Container
Upload Args Specifies files to upload to the container before starting it. Only one of
content
orcontent_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
oruser:group
which user and group can be passed literraly or by name.- Userns
Mode string Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
- Volumes
[]Container
Volume Args Spec for mounting volumes in the container.
- Wait bool
If
true
, then the Docker container is waited for being healthy state after creation. Iffalse
, then the container health state is not checked. Defaults tofalse
.- Wait
Timeout int The timeout in seconds to wait the container to be healthy after creation. Defaults to
60
.- Working
Dir 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 tofalse
.- capabilities
Container
Capabilities Args Add or drop certrain linux capabilities.
- cgroupns
Mode String Cgroup namespace mode to use for the container. Possible values are:
private
,host
.- 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","-f","baz.con"]
.- container
Read IntegerRefresh Timeout Milliseconds The total number of milliseconds to wait for the container to reach status 'running'
- cpu
Set String A comma-separated list or hyphen-separated range of CPUs a container can use, e.g.
0-1
.- Integer
CPU shares (relative weight) for the container.
- destroy
Grace IntegerSeconds If defined will attempt to stop the container before destroying. Container will be destroyed after
n
seconds or on successful stop.- devices
List<Container
Device Args> Bind devices to the container.
- dns List<String>
DNS servers to use.
- dns
Opts List<String> DNS options used by the DNS provider(s), see
resolv.conf
documentation for valid list of options.- dns
Searches 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
- gpus String
GPU devices to add to the container. Currently, only the value
all
is supported. Passing any other value will result in unexpected behavior.- group
Adds List<String> Additional groups for the container user
- healthcheck
Container
Healthcheck Args A test to perform to check that the container is healthy
- hostname String
Hostname of the container.
- hosts
List<Container
Host Args> 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.- ipc
Mode String IPC sharing mode for the container. Possible values are:
none
,private
,shareable
,container:<name|id>
orhost
.- labels
List<Container
Label Args> User-defined key/value metadata
- log
Driver String The logging driver to use for the container.
- log
Opts Map<String,Object> Key/value pairs to use as options for the logging driver.
- logs Boolean
Save the container logs (
attach
must be enabled). Defaults tofalse
.- max
Retry IntegerCount 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.
- memory
Swap Integer The total memory limit (memory + swap) for the container in MBs. This setting may compute to
-1
afterpulumi up
if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.- mounts
List<Container
Mount Args> Specification for mounts to be added to containers created as part of the service.
- must
Run Boolean If
true
, then the Docker container will be kept running. Iffalse
, then as long as the container exists, Terraform assumes it is successful. Defaults totrue
.- name String
The name of the container.
- network
Mode String Network mode of the container.
- networks
Advanced List<ContainerNetworks Advanced Args> The networks the container is attached to
- pid
Mode String he PID (Process) Namespace mode for the container. Either
container:<name|id>
orhost
.- ports
List<Container
Port Args> Publish a container's port(s) to the host.
- privileged Boolean
If
true
, the container runs in privileged mode.- publish
All BooleanPorts Publish all ports of the container.
- read
Only Boolean If
true
, the container will be started as readonly. Defaults tofalse
.- remove
Volumes Boolean If
true
, it will remove anonymous volumes associated with the container. Defaults totrue
.- 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 tofalse
.- runtime String
Runtime to use for the container.
- security
Opts 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.
- shm
Size Integer Size of
/dev/shm
in MBs.- start Boolean
If
true
, then the Docker container will be started after creation. Iffalse
, then the container is only created. Defaults totrue
.- stdin
Open Boolean If
true
, keep STDIN open even if not attached (docker run -i
). Defaults tofalse
.- stop
Signal String Signal to stop a container (default
SIGTERM
).- stop
Timeout Integer Timeout (in seconds) to stop a container.
- storage
Opts Map<String,Object> Key/value pairs for the storage driver options, e.g.
size
:120G
- sysctls Map<String,Object>
A map of kernel parameters (sysctls) to set in the container.
- tmpfs Map<String,Object>
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 tofalse
.- ulimits
List<Container
Ulimit Args> Ulimit options to add.
- uploads
List<Container
Upload Args> Specifies files to upload to the container before starting it. Only one of
content
orcontent_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
oruser:group
which user and group can be passed literraly or by name.- userns
Mode String Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
- volumes
List<Container
Volume Args> Spec for mounting volumes in the container.
- wait
Timeout Integer The timeout in seconds to wait the container to be healthy after creation. Defaults to
60
.- wait_ Boolean
If
true
, then the Docker container is waited for being healthy state after creation. Iffalse
, then the container health state is not checked. Defaults tofalse
.- working
Dir 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 tofalse
.- capabilities
Container
Capabilities Args Add or drop certrain linux capabilities.
- cgroupns
Mode string Cgroup namespace mode to use for the container. Possible values are:
private
,host
.- 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","-f","baz.con"]
.- container
Read numberRefresh Timeout Milliseconds The total number of milliseconds to wait for the container to reach status 'running'
- cpu
Set string A comma-separated list or hyphen-separated range of CPUs a container can use, e.g.
0-1
.- number
CPU shares (relative weight) for the container.
- destroy
Grace numberSeconds If defined will attempt to stop the container before destroying. Container will be destroyed after
n
seconds or on successful stop.- devices
Container
Device Args[] Bind devices to the container.
- dns string[]
DNS servers to use.
- dns
Opts string[] DNS options used by the DNS provider(s), see
resolv.conf
documentation for valid list of options.- dns
Searches 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
- gpus string
GPU devices to add to the container. Currently, only the value
all
is supported. Passing any other value will result in unexpected behavior.- group
Adds string[] Additional groups for the container user
- healthcheck
Container
Healthcheck Args A test to perform to check that the container is healthy
- hostname string
Hostname of the container.
- hosts
Container
Host Args[] 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.- ipc
Mode string IPC sharing mode for the container. Possible values are:
none
,private
,shareable
,container:<name|id>
orhost
.- labels
Container
Label Args[] User-defined key/value metadata
- log
Driver string The logging driver to use for the container.
- log
Opts {[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 tofalse
.- max
Retry numberCount 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.
- memory
Swap number The total memory limit (memory + swap) for the container in MBs. This setting may compute to
-1
afterpulumi up
if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.- mounts
Container
Mount Args[] Specification for mounts to be added to containers created as part of the service.
- must
Run boolean If
true
, then the Docker container will be kept running. Iffalse
, then as long as the container exists, Terraform assumes it is successful. Defaults totrue
.- name string
The name of the container.
- network
Mode string Network mode of the container.
- networks
Advanced ContainerNetworks Advanced Args[] The networks the container is attached to
- pid
Mode string he PID (Process) Namespace mode for the container. Either
container:<name|id>
orhost
.- ports
Container
Port Args[] Publish a container's port(s) to the host.
- privileged boolean
If
true
, the container runs in privileged mode.- publish
All booleanPorts Publish all ports of the container.
- read
Only boolean If
true
, the container will be started as readonly. Defaults tofalse
.- remove
Volumes boolean If
true
, it will remove anonymous volumes associated with the container. Defaults totrue
.- 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 tofalse
.- runtime string
Runtime to use for the container.
- security
Opts string[] List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.
- shm
Size number Size of
/dev/shm
in MBs.- start boolean
If
true
, then the Docker container will be started after creation. Iffalse
, then the container is only created. Defaults totrue
.- stdin
Open boolean If
true
, keep STDIN open even if not attached (docker run -i
). Defaults tofalse
.- stop
Signal string Signal to stop a container (default
SIGTERM
).- stop
Timeout number Timeout (in seconds) to stop a container.
- storage
Opts {[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 tofalse
.- ulimits
Container
Ulimit Args[] Ulimit options to add.
- uploads
Container
Upload Args[] Specifies files to upload to the container before starting it. Only one of
content
orcontent_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
oruser:group
which user and group can be passed literraly or by name.- userns
Mode string Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
- volumes
Container
Volume Args[] Spec for mounting volumes in the container.
- wait boolean
If
true
, then the Docker container is waited for being healthy state after creation. Iffalse
, then the container health state is not checked. Defaults tofalse
.- wait
Timeout number The timeout in seconds to wait the container to be healthy after creation. Defaults to
60
.- working
Dir 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 tofalse
.- capabilities
Container
Capabilities Args Add or drop certrain linux capabilities.
- cgroupns_
mode str Cgroup namespace mode to use for the container. Possible values are:
private
,host
.- 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","-f","baz.con"]
.- container_
read_ intrefresh_ timeout_ milliseconds The total number of milliseconds to wait for the container to reach status 'running'
- cpu_
set str A comma-separated list or hyphen-separated range of CPUs a container can use, e.g.
0-1
.- int
CPU shares (relative weight) for the container.
- destroy_
grace_ intseconds If defined will attempt to stop the container before destroying. Container will be destroyed after
n
seconds or on successful stop.- devices
Sequence[Container
Device Args] 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
- gpus str
GPU devices to add to the container. Currently, only the value
all
is supported. Passing any other value will result in unexpected behavior.- group_
adds Sequence[str] Additional groups for the container user
- healthcheck
Container
Healthcheck Args A test to perform to check that the container is healthy
- hostname str
Hostname of the container.
- hosts
Sequence[Container
Host Args] 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>
orhost
.- labels
Sequence[Container
Label Args] User-defined key/value metadata
- 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 tofalse
.- max_
retry_ intcount 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
afterpulumi up
if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.- mounts
Sequence[Container
Mount Args] 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. Iffalse
, then as long as the container exists, Terraform assumes it is successful. Defaults totrue
.- name str
The name of the container.
- network_
mode str Network mode of the container.
- networks_
advanced Sequence[ContainerNetworks Advanced Args] The networks the container is attached to
- pid_
mode str he PID (Process) Namespace mode for the container. Either
container:<name|id>
orhost
.- ports
Sequence[Container
Port Args] Publish a container's port(s) to the host.
- privileged bool
If
true
, the container runs in privileged mode.- publish_
all_ boolports Publish all ports of the container.
- read_
only bool If
true
, the container will be started as readonly. Defaults tofalse
.- remove_
volumes bool If
true
, it will remove anonymous volumes associated with the container. Defaults totrue
.- 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 tofalse
.- runtime str
Runtime to use for the container.
- 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. Iffalse
, then the container is only created. Defaults totrue
.- stdin_
open bool If
true
, keep STDIN open even if not attached (docker run -i
). Defaults tofalse
.- stop_
signal str Signal to stop a container (default
SIGTERM
).- stop_
timeout int Timeout (in seconds) to stop a container.
- 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 tofalse
.- ulimits
Sequence[Container
Ulimit Args] Ulimit options to add.
- uploads
Sequence[Container
Upload Args] Specifies files to upload to the container before starting it. Only one of
content
orcontent_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
oruser: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[Container
Volume Args] Spec for mounting volumes in the container.
- wait bool
If
true
, then the Docker container is waited for being healthy state after creation. Iffalse
, then the container health state is not checked. Defaults tofalse
.- wait_
timeout int The timeout in seconds to wait the container to be healthy after creation. Defaults to
60
.- 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 tofalse
.- capabilities Property Map
Add or drop certrain linux capabilities.
- cgroupns
Mode String Cgroup namespace mode to use for the container. Possible values are:
private
,host
.- 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","-f","baz.con"]
.- container
Read NumberRefresh Timeout Milliseconds The total number of milliseconds to wait for the container to reach status 'running'
- cpu
Set String A comma-separated list or hyphen-separated range of CPUs a container can use, e.g.
0-1
.- Number
CPU shares (relative weight) for the container.
- destroy
Grace NumberSeconds If defined will attempt to stop the container before destroying. Container will be destroyed after
n
seconds or on successful stop.- devices List<Property Map>
Bind devices to the container.
- dns List<String>
DNS servers to use.
- dns
Opts List<String> DNS options used by the DNS provider(s), see
resolv.conf
documentation for valid list of options.- dns
Searches 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
- gpus String
GPU devices to add to the container. Currently, only the value
all
is supported. Passing any other value will result in unexpected behavior.- group
Adds List<String> 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<Property Map>
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.- ipc
Mode String IPC sharing mode for the container. Possible values are:
none
,private
,shareable
,container:<name|id>
orhost
.- labels List<Property Map>
User-defined key/value metadata
- log
Driver String The logging driver to use for the container.
- log
Opts Map<Any> Key/value pairs to use as options for the logging driver.
- logs Boolean
Save the container logs (
attach
must be enabled). Defaults tofalse
.- max
Retry NumberCount 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.
- memory
Swap Number The total memory limit (memory + swap) for the container in MBs. This setting may compute to
-1
afterpulumi up
if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.- mounts List<Property Map>
Specification for mounts to be added to containers created as part of the service.
- must
Run Boolean If
true
, then the Docker container will be kept running. Iffalse
, then as long as the container exists, Terraform assumes it is successful. Defaults totrue
.- name String
The name of the container.
- network
Mode String Network mode of the container.
- networks
Advanced List<Property Map> The networks the container is attached to
- pid
Mode String he PID (Process) Namespace mode for the container. Either
container:<name|id>
orhost
.- ports List<Property Map>
Publish a container's port(s) to the host.
- privileged Boolean
If
true
, the container runs in privileged mode.- publish
All BooleanPorts Publish all ports of the container.
- read
Only Boolean If
true
, the container will be started as readonly. Defaults tofalse
.- remove
Volumes Boolean If
true
, it will remove anonymous volumes associated with the container. Defaults totrue
.- 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 tofalse
.- runtime String
Runtime to use for the container.
- security
Opts 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.
- shm
Size Number Size of
/dev/shm
in MBs.- start Boolean
If
true
, then the Docker container will be started after creation. Iffalse
, then the container is only created. Defaults totrue
.- stdin
Open Boolean If
true
, keep STDIN open even if not attached (docker run -i
). Defaults tofalse
.- stop
Signal String Signal to stop a container (default
SIGTERM
).- stop
Timeout Number Timeout (in seconds) to stop a container.
- storage
Opts Map<Any> Key/value pairs for the storage driver options, e.g.
size
:120G
- sysctls Map<Any>
A map of kernel parameters (sysctls) to set in the container.
- tmpfs Map<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 tofalse
.- ulimits List<Property Map>
Ulimit options to add.
- uploads List<Property Map>
Specifies files to upload to the container before starting it. Only one of
content
orcontent_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
oruser:group
which user and group can be passed literraly or by name.- userns
Mode String Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
- volumes List<Property Map>
Spec for mounting volumes in the container.
- wait Boolean
If
true
, then the Docker container is waited for being healthy state after creation. Iffalse
, then the container health state is not checked. Defaults tofalse
.- wait
Timeout Number The timeout in seconds to wait the container to be healthy after creation. Defaults to
60
.- working
Dir 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.
- Container
Logs string 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).- Id string
The provider-assigned unique ID for this managed resource.
- Network
Datas List<ContainerNetwork Data> The data of the networks the container is connected to.
- Bridge string
The network bridge of the container as read from its NetworkSettings.
- Container
Logs string 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).- Id string
The provider-assigned unique ID for this managed resource.
- Network
Datas []ContainerNetwork Data The data of the networks the container is connected to.
- bridge String
The network bridge of the container as read from its NetworkSettings.
- container
Logs String The logs of the container if its execution is done (
attach
must be disabled).- exit
Code Integer The exit code of the container if its execution is done (
must_run
must be disabled).- id String
The provider-assigned unique ID for this managed resource.
- network
Datas List<ContainerNetwork Data> The data of the networks the container is connected to.
- bridge string
The network bridge of the container as read from its NetworkSettings.
- container
Logs string The logs of the container if its execution is done (
attach
must be disabled).- exit
Code number The exit code of the container if its execution is done (
must_run
must be disabled).- id string
The provider-assigned unique ID for this managed resource.
- network
Datas ContainerNetwork Data[] 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).- id str
The provider-assigned unique ID for this managed resource.
- network_
datas Sequence[ContainerNetwork Data] The data of the networks the container is connected to.
- bridge String
The network bridge of the container as read from its NetworkSettings.
- container
Logs String The logs of the container if its execution is done (
attach
must be disabled).- exit
Code Number The exit code of the container if its execution is done (
must_run
must be disabled).- id String
The provider-assigned unique ID for this managed resource.
- network
Datas List<Property Map> The data of the networks the container is connected to.
Look up 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,
cgroupns_mode: Optional[str] = None,
command: Optional[Sequence[str]] = None,
container_logs: Optional[str] = None,
container_read_refresh_timeout_milliseconds: Optional[int] = 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,
gpus: 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,
ipc_mode: Optional[str] = None,
labels: Optional[Sequence[ContainerLabelArgs]] = 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_datas: Optional[Sequence[ContainerNetworkDataArgs]] = None,
network_mode: Optional[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,
runtime: Optional[str] = None,
security_opts: Optional[Sequence[str]] = None,
shm_size: Optional[int] = None,
start: Optional[bool] = None,
stdin_open: Optional[bool] = None,
stop_signal: Optional[str] = None,
stop_timeout: Optional[int] = 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,
wait: Optional[bool] = None,
wait_timeout: Optional[int] = 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.
- Attach bool
If
true
attach to the container after its creation and waits the end of its execution. Defaults tofalse
.- Bridge string
The network bridge of the container as read from its NetworkSettings.
- Capabilities
Container
Capabilities Args Add or drop certrain linux capabilities.
- Cgroupns
Mode string Cgroup namespace mode to use for the container. Possible values are:
private
,host
.- 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","-f","baz.con"]
.- Container
Logs string The logs of the container if its execution is done (
attach
must be disabled).- Container
Read intRefresh Timeout Milliseconds The total number of milliseconds to wait for the container to reach status 'running'
- Cpu
Set string A comma-separated list or hyphen-separated range of CPUs a container can use, e.g.
0-1
.- int
CPU shares (relative weight) for the container.
- Destroy
Grace intSeconds If defined will attempt to stop the container before destroying. Container will be destroyed after
n
seconds or on successful stop.- Devices
List<Container
Device Args> Bind devices to the container.
- Dns List<string>
DNS servers to use.
- Dns
Opts List<string> DNS options used by the DNS provider(s), see
resolv.conf
documentation for valid list of options.- Dns
Searches 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
- Exit
Code int The exit code of the container if its execution is done (
must_run
must be disabled).- Gpus string
GPU devices to add to the container. Currently, only the value
all
is supported. Passing any other value will result in unexpected behavior.- Group
Adds List<string> Additional groups for the container user
- Healthcheck
Container
Healthcheck Args A test to perform to check that the container is healthy
- Hostname string
Hostname of the container.
- Hosts
List<Container
Host Args> 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.- Ipc
Mode string IPC sharing mode for the container. Possible values are:
none
,private
,shareable
,container:<name|id>
orhost
.- Labels
List<Container
Label Args> User-defined key/value metadata
- Log
Driver string The logging driver to use for the container.
- Log
Opts 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 tofalse
.- Max
Retry intCount 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
afterpulumi up
if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.- Mounts
List<Container
Mount Args> 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. Iffalse
, then as long as the container exists, Terraform assumes it is successful. Defaults totrue
.- Name string
The name of the container.
- Network
Datas List<ContainerNetwork Data Args> The data of the networks the container is connected to.
- Network
Mode string Network mode of the container.
- Networks
Advanced List<ContainerNetworks Advanced Args> The networks the container is attached to
- Pid
Mode string he PID (Process) Namespace mode for the container. Either
container:<name|id>
orhost
.- Ports
List<Container
Port Args> Publish a container's port(s) to the host.
- Privileged bool
If
true
, the container runs in privileged mode.- Publish
All boolPorts Publish all ports of the container.
- Read
Only bool If
true
, the container will be started as readonly. Defaults tofalse
.- Remove
Volumes bool If
true
, it will remove anonymous volumes associated with the container. Defaults totrue
.- 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 tofalse
.- Runtime string
Runtime to use for the container.
- Security
Opts 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.
- Shm
Size int Size of
/dev/shm
in MBs.- Start bool
If
true
, then the Docker container will be started after creation. Iffalse
, then the container is only created. Defaults totrue
.- Stdin
Open bool If
true
, keep STDIN open even if not attached (docker run -i
). Defaults tofalse
.- Stop
Signal string Signal to stop a container (default
SIGTERM
).- Stop
Timeout int Timeout (in seconds) to stop a container.
- Storage
Opts 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 tofalse
.- Ulimits
List<Container
Ulimit Args> Ulimit options to add.
- Uploads
List<Container
Upload Args> Specifies files to upload to the container before starting it. Only one of
content
orcontent_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
oruser:group
which user and group can be passed literraly or by name.- Userns
Mode string Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
- Volumes
List<Container
Volume Args> Spec for mounting volumes in the container.
- Wait bool
If
true
, then the Docker container is waited for being healthy state after creation. Iffalse
, then the container health state is not checked. Defaults tofalse
.- Wait
Timeout int The timeout in seconds to wait the container to be healthy after creation. Defaults to
60
.- Working
Dir 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 tofalse
.- Bridge string
The network bridge of the container as read from its NetworkSettings.
- Capabilities
Container
Capabilities Args Add or drop certrain linux capabilities.
- Cgroupns
Mode string Cgroup namespace mode to use for the container. Possible values are:
private
,host
.- 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","-f","baz.con"]
.- Container
Logs string The logs of the container if its execution is done (
attach
must be disabled).- Container
Read intRefresh Timeout Milliseconds The total number of milliseconds to wait for the container to reach status 'running'
- Cpu
Set string A comma-separated list or hyphen-separated range of CPUs a container can use, e.g.
0-1
.- int
CPU shares (relative weight) for the container.
- Destroy
Grace intSeconds If defined will attempt to stop the container before destroying. Container will be destroyed after
n
seconds or on successful stop.- Devices
[]Container
Device Args Bind devices to the container.
- Dns []string
DNS servers to use.
- Dns
Opts []string DNS options used by the DNS provider(s), see
resolv.conf
documentation for valid list of options.- Dns
Searches []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
- Exit
Code int The exit code of the container if its execution is done (
must_run
must be disabled).- Gpus string
GPU devices to add to the container. Currently, only the value
all
is supported. Passing any other value will result in unexpected behavior.- Group
Adds []string Additional groups for the container user
- Healthcheck
Container
Healthcheck Args A test to perform to check that the container is healthy
- Hostname string
Hostname of the container.
- Hosts
[]Container
Host Args 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.- Ipc
Mode string IPC sharing mode for the container. Possible values are:
none
,private
,shareable
,container:<name|id>
orhost
.- Labels
[]Container
Label Args User-defined key/value metadata
- Log
Driver string The logging driver to use for the container.
- Log
Opts 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 tofalse
.- Max
Retry intCount 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
afterpulumi up
if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.- Mounts
[]Container
Mount Args 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. Iffalse
, then as long as the container exists, Terraform assumes it is successful. Defaults totrue
.- Name string
The name of the container.
- Network
Datas []ContainerNetwork Data Args The data of the networks the container is connected to.
- Network
Mode string Network mode of the container.
- Networks
Advanced []ContainerNetworks Advanced Args The networks the container is attached to
- Pid
Mode string he PID (Process) Namespace mode for the container. Either
container:<name|id>
orhost
.- Ports
[]Container
Port Args Publish a container's port(s) to the host.
- Privileged bool
If
true
, the container runs in privileged mode.- Publish
All boolPorts Publish all ports of the container.
- Read
Only bool If
true
, the container will be started as readonly. Defaults tofalse
.- Remove
Volumes bool If
true
, it will remove anonymous volumes associated with the container. Defaults totrue
.- 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 tofalse
.- Runtime string
Runtime to use for the container.
- Security
Opts []string List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.
- Shm
Size int Size of
/dev/shm
in MBs.- Start bool
If
true
, then the Docker container will be started after creation. Iffalse
, then the container is only created. Defaults totrue
.- Stdin
Open bool If
true
, keep STDIN open even if not attached (docker run -i
). Defaults tofalse
.- Stop
Signal string Signal to stop a container (default
SIGTERM
).- Stop
Timeout int Timeout (in seconds) to stop a container.
- Storage
Opts 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 tofalse
.- Ulimits
[]Container
Ulimit Args Ulimit options to add.
- Uploads
[]Container
Upload Args Specifies files to upload to the container before starting it. Only one of
content
orcontent_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
oruser:group
which user and group can be passed literraly or by name.- Userns
Mode string Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
- Volumes
[]Container
Volume Args Spec for mounting volumes in the container.
- Wait bool
If
true
, then the Docker container is waited for being healthy state after creation. Iffalse
, then the container health state is not checked. Defaults tofalse
.- Wait
Timeout int The timeout in seconds to wait the container to be healthy after creation. Defaults to
60
.- Working
Dir 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 tofalse
.- bridge String
The network bridge of the container as read from its NetworkSettings.
- capabilities
Container
Capabilities Args Add or drop certrain linux capabilities.
- cgroupns
Mode String Cgroup namespace mode to use for the container. Possible values are:
private
,host
.- 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","-f","baz.con"]
.- container
Logs String The logs of the container if its execution is done (
attach
must be disabled).- container
Read IntegerRefresh Timeout Milliseconds The total number of milliseconds to wait for the container to reach status 'running'
- cpu
Set String A comma-separated list or hyphen-separated range of CPUs a container can use, e.g.
0-1
.- Integer
CPU shares (relative weight) for the container.
- destroy
Grace IntegerSeconds If defined will attempt to stop the container before destroying. Container will be destroyed after
n
seconds or on successful stop.- devices
List<Container
Device Args> Bind devices to the container.
- dns List<String>
DNS servers to use.
- dns
Opts List<String> DNS options used by the DNS provider(s), see
resolv.conf
documentation for valid list of options.- dns
Searches 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
- exit
Code Integer The exit code of the container if its execution is done (
must_run
must be disabled).- gpus String
GPU devices to add to the container. Currently, only the value
all
is supported. Passing any other value will result in unexpected behavior.- group
Adds List<String> Additional groups for the container user
- healthcheck
Container
Healthcheck Args A test to perform to check that the container is healthy
- hostname String
Hostname of the container.
- hosts
List<Container
Host Args> 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.- ipc
Mode String IPC sharing mode for the container. Possible values are:
none
,private
,shareable
,container:<name|id>
orhost
.- labels
List<Container
Label Args> User-defined key/value metadata
- log
Driver String The logging driver to use for the container.
- log
Opts Map<String,Object> Key/value pairs to use as options for the logging driver.
- logs Boolean
Save the container logs (
attach
must be enabled). Defaults tofalse
.- max
Retry IntegerCount 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.
- memory
Swap Integer The total memory limit (memory + swap) for the container in MBs. This setting may compute to
-1
afterpulumi up
if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.- mounts
List<Container
Mount Args> Specification for mounts to be added to containers created as part of the service.
- must
Run Boolean If
true
, then the Docker container will be kept running. Iffalse
, then as long as the container exists, Terraform assumes it is successful. Defaults totrue
.- name String
The name of the container.
- network
Datas List<ContainerNetwork Data Args> The data of the networks the container is connected to.
- network
Mode String Network mode of the container.
- networks
Advanced List<ContainerNetworks Advanced Args> The networks the container is attached to
- pid
Mode String he PID (Process) Namespace mode for the container. Either
container:<name|id>
orhost
.- ports
List<Container
Port Args> Publish a container's port(s) to the host.
- privileged Boolean
If
true
, the container runs in privileged mode.- publish
All BooleanPorts Publish all ports of the container.
- read
Only Boolean If
true
, the container will be started as readonly. Defaults tofalse
.- remove
Volumes Boolean If
true
, it will remove anonymous volumes associated with the container. Defaults totrue
.- 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 tofalse
.- runtime String
Runtime to use for the container.
- security
Opts 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.
- shm
Size Integer Size of
/dev/shm
in MBs.- start Boolean
If
true
, then the Docker container will be started after creation. Iffalse
, then the container is only created. Defaults totrue
.- stdin
Open Boolean If
true
, keep STDIN open even if not attached (docker run -i
). Defaults tofalse
.- stop
Signal String Signal to stop a container (default
SIGTERM
).- stop
Timeout Integer Timeout (in seconds) to stop a container.
- storage
Opts Map<String,Object> Key/value pairs for the storage driver options, e.g.
size
:120G
- sysctls Map<String,Object>
A map of kernel parameters (sysctls) to set in the container.
- tmpfs Map<String,Object>
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 tofalse
.- ulimits
List<Container
Ulimit Args> Ulimit options to add.
- uploads
List<Container
Upload Args> Specifies files to upload to the container before starting it. Only one of
content
orcontent_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
oruser:group
which user and group can be passed literraly or by name.- userns
Mode String Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
- volumes
List<Container
Volume Args> Spec for mounting volumes in the container.
- wait
Timeout Integer The timeout in seconds to wait the container to be healthy after creation. Defaults to
60
.- wait_ Boolean
If
true
, then the Docker container is waited for being healthy state after creation. Iffalse
, then the container health state is not checked. Defaults tofalse
.- working
Dir 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 tofalse
.- bridge string
The network bridge of the container as read from its NetworkSettings.
- capabilities
Container
Capabilities Args Add or drop certrain linux capabilities.
- cgroupns
Mode string Cgroup namespace mode to use for the container. Possible values are:
private
,host
.- 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","-f","baz.con"]
.- container
Logs string The logs of the container if its execution is done (
attach
must be disabled).- container
Read numberRefresh Timeout Milliseconds The total number of milliseconds to wait for the container to reach status 'running'
- cpu
Set string A comma-separated list or hyphen-separated range of CPUs a container can use, e.g.
0-1
.- number
CPU shares (relative weight) for the container.
- destroy
Grace numberSeconds If defined will attempt to stop the container before destroying. Container will be destroyed after
n
seconds or on successful stop.- devices
Container
Device Args[] Bind devices to the container.
- dns string[]
DNS servers to use.
- dns
Opts string[] DNS options used by the DNS provider(s), see
resolv.conf
documentation for valid list of options.- dns
Searches 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
- exit
Code number The exit code of the container if its execution is done (
must_run
must be disabled).- gpus string
GPU devices to add to the container. Currently, only the value
all
is supported. Passing any other value will result in unexpected behavior.- group
Adds string[] Additional groups for the container user
- healthcheck
Container
Healthcheck Args A test to perform to check that the container is healthy
- hostname string
Hostname of the container.
- hosts
Container
Host Args[] 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.- ipc
Mode string IPC sharing mode for the container. Possible values are:
none
,private
,shareable
,container:<name|id>
orhost
.- labels
Container
Label Args[] User-defined key/value metadata
- log
Driver string The logging driver to use for the container.
- log
Opts {[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 tofalse
.- max
Retry numberCount 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.
- memory
Swap number The total memory limit (memory + swap) for the container in MBs. This setting may compute to
-1
afterpulumi up
if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.- mounts
Container
Mount Args[] Specification for mounts to be added to containers created as part of the service.
- must
Run boolean If
true
, then the Docker container will be kept running. Iffalse
, then as long as the container exists, Terraform assumes it is successful. Defaults totrue
.- name string
The name of the container.
- network
Datas ContainerNetwork Data Args[] The data of the networks the container is connected to.
- network
Mode string Network mode of the container.
- networks
Advanced ContainerNetworks Advanced Args[] The networks the container is attached to
- pid
Mode string he PID (Process) Namespace mode for the container. Either
container:<name|id>
orhost
.- ports
Container
Port Args[] Publish a container's port(s) to the host.
- privileged boolean
If
true
, the container runs in privileged mode.- publish
All booleanPorts Publish all ports of the container.
- read
Only boolean If
true
, the container will be started as readonly. Defaults tofalse
.- remove
Volumes boolean If
true
, it will remove anonymous volumes associated with the container. Defaults totrue
.- 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 tofalse
.- runtime string
Runtime to use for the container.
- security
Opts string[] List of string values to customize labels for MLS systems, such as SELinux. See https://docs.docker.com/engine/reference/run/#security-configuration.
- shm
Size number Size of
/dev/shm
in MBs.- start boolean
If
true
, then the Docker container will be started after creation. Iffalse
, then the container is only created. Defaults totrue
.- stdin
Open boolean If
true
, keep STDIN open even if not attached (docker run -i
). Defaults tofalse
.- stop
Signal string Signal to stop a container (default
SIGTERM
).- stop
Timeout number Timeout (in seconds) to stop a container.
- storage
Opts {[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 tofalse
.- ulimits
Container
Ulimit Args[] Ulimit options to add.
- uploads
Container
Upload Args[] Specifies files to upload to the container before starting it. Only one of
content
orcontent_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
oruser:group
which user and group can be passed literraly or by name.- userns
Mode string Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
- volumes
Container
Volume Args[] Spec for mounting volumes in the container.
- wait boolean
If
true
, then the Docker container is waited for being healthy state after creation. Iffalse
, then the container health state is not checked. Defaults tofalse
.- wait
Timeout number The timeout in seconds to wait the container to be healthy after creation. Defaults to
60
.- working
Dir 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 tofalse
.- bridge str
The network bridge of the container as read from its NetworkSettings.
- capabilities
Container
Capabilities Args Add or drop certrain linux capabilities.
- cgroupns_
mode str Cgroup namespace mode to use for the container. Possible values are:
private
,host
.- 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","-f","baz.con"]
.- container_
logs str The logs of the container if its execution is done (
attach
must be disabled).- container_
read_ intrefresh_ timeout_ milliseconds The total number of milliseconds to wait for the container to reach status 'running'
- cpu_
set str A comma-separated list or hyphen-separated range of CPUs a container can use, e.g.
0-1
.- int
CPU shares (relative weight) for the container.
- destroy_
grace_ intseconds If defined will attempt to stop the container before destroying. Container will be destroyed after
n
seconds or on successful stop.- devices
Sequence[Container
Device Args] 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).- gpus str
GPU devices to add to the container. Currently, only the value
all
is supported. Passing any other value will result in unexpected behavior.- group_
adds Sequence[str] Additional groups for the container user
- healthcheck
Container
Healthcheck Args A test to perform to check that the container is healthy
- hostname str
Hostname of the container.
- hosts
Sequence[Container
Host Args] 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.- ipc_
mode str IPC sharing mode for the container. Possible values are:
none
,private
,shareable
,container:<name|id>
orhost
.- labels
Sequence[Container
Label Args] User-defined key/value metadata
- 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 tofalse
.- max_
retry_ intcount 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
afterpulumi up
if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.- mounts
Sequence[Container
Mount Args] 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. Iffalse
, then as long as the container exists, Terraform assumes it is successful. Defaults totrue
.- name str
The name of the container.
- network_
datas Sequence[ContainerNetwork Data Args] The data of the networks the container is connected to.
- network_
mode str Network mode of the container.
- networks_
advanced Sequence[ContainerNetworks Advanced Args] The networks the container is attached to
- pid_
mode str he PID (Process) Namespace mode for the container. Either
container:<name|id>
orhost
.- ports
Sequence[Container
Port Args] Publish a container's port(s) to the host.
- privileged bool
If
true
, the container runs in privileged mode.- publish_
all_ boolports Publish all ports of the container.
- read_
only bool If
true
, the container will be started as readonly. Defaults tofalse
.- remove_
volumes bool If
true
, it will remove anonymous volumes associated with the container. Defaults totrue
.- 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 tofalse
.- runtime str
Runtime to use for the container.
- 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. Iffalse
, then the container is only created. Defaults totrue
.- stdin_
open bool If
true
, keep STDIN open even if not attached (docker run -i
). Defaults tofalse
.- stop_
signal str Signal to stop a container (default
SIGTERM
).- stop_
timeout int Timeout (in seconds) to stop a container.
- 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 tofalse
.- ulimits
Sequence[Container
Ulimit Args] Ulimit options to add.
- uploads
Sequence[Container
Upload Args] Specifies files to upload to the container before starting it. Only one of
content
orcontent_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
oruser: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[Container
Volume Args] Spec for mounting volumes in the container.
- wait bool
If
true
, then the Docker container is waited for being healthy state after creation. Iffalse
, then the container health state is not checked. Defaults tofalse
.- wait_
timeout int The timeout in seconds to wait the container to be healthy after creation. Defaults to
60
.- 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 tofalse
.- bridge String
The network bridge of the container as read from its NetworkSettings.
- capabilities Property Map
Add or drop certrain linux capabilities.
- cgroupns
Mode String Cgroup namespace mode to use for the container. Possible values are:
private
,host
.- 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","-f","baz.con"]
.- container
Logs String The logs of the container if its execution is done (
attach
must be disabled).- container
Read NumberRefresh Timeout Milliseconds The total number of milliseconds to wait for the container to reach status 'running'
- cpu
Set String A comma-separated list or hyphen-separated range of CPUs a container can use, e.g.
0-1
.- Number
CPU shares (relative weight) for the container.
- destroy
Grace NumberSeconds If defined will attempt to stop the container before destroying. Container will be destroyed after
n
seconds or on successful stop.- devices List<Property Map>
Bind devices to the container.
- dns List<String>
DNS servers to use.
- dns
Opts List<String> DNS options used by the DNS provider(s), see
resolv.conf
documentation for valid list of options.- dns
Searches 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
- exit
Code Number The exit code of the container if its execution is done (
must_run
must be disabled).- gpus String
GPU devices to add to the container. Currently, only the value
all
is supported. Passing any other value will result in unexpected behavior.- group
Adds List<String> 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<Property Map>
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.- ipc
Mode String IPC sharing mode for the container. Possible values are:
none
,private
,shareable
,container:<name|id>
orhost
.- labels List<Property Map>
User-defined key/value metadata
- log
Driver String The logging driver to use for the container.
- log
Opts Map<Any> Key/value pairs to use as options for the logging driver.
- logs Boolean
Save the container logs (
attach
must be enabled). Defaults tofalse
.- max
Retry NumberCount 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.
- memory
Swap Number The total memory limit (memory + swap) for the container in MBs. This setting may compute to
-1
afterpulumi up
if the target host doesn't support memory swap, when that is the case docker will use a soft limitation.- mounts List<Property Map>
Specification for mounts to be added to containers created as part of the service.
- must
Run Boolean If
true
, then the Docker container will be kept running. Iffalse
, then as long as the container exists, Terraform assumes it is successful. Defaults totrue
.- name String
The name of the container.
- network
Datas List<Property Map> The data of the networks the container is connected to.
- network
Mode String Network mode of the container.
- networks
Advanced List<Property Map> The networks the container is attached to
- pid
Mode String he PID (Process) Namespace mode for the container. Either
container:<name|id>
orhost
.- ports List<Property Map>
Publish a container's port(s) to the host.
- privileged Boolean
If
true
, the container runs in privileged mode.- publish
All BooleanPorts Publish all ports of the container.
- read
Only Boolean If
true
, the container will be started as readonly. Defaults tofalse
.- remove
Volumes Boolean If
true
, it will remove anonymous volumes associated with the container. Defaults totrue
.- 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 tofalse
.- runtime String
Runtime to use for the container.
- security
Opts 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.
- shm
Size Number Size of
/dev/shm
in MBs.- start Boolean
If
true
, then the Docker container will be started after creation. Iffalse
, then the container is only created. Defaults totrue
.- stdin
Open Boolean If
true
, keep STDIN open even if not attached (docker run -i
). Defaults tofalse
.- stop
Signal String Signal to stop a container (default
SIGTERM
).- stop
Timeout Number Timeout (in seconds) to stop a container.
- storage
Opts Map<Any> Key/value pairs for the storage driver options, e.g.
size
:120G
- sysctls Map<Any>
A map of kernel parameters (sysctls) to set in the container.
- tmpfs Map<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 tofalse
.- ulimits List<Property Map>
Ulimit options to add.
- uploads List<Property Map>
Specifies files to upload to the container before starting it. Only one of
content
orcontent_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
oruser:group
which user and group can be passed literraly or by name.- userns
Mode String Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
- volumes List<Property Map>
Spec for mounting volumes in the container.
- wait Boolean
If
true
, then the Docker container is waited for being healthy state after creation. Iffalse
, then the container health state is not checked. Defaults tofalse
.- wait
Timeout Number The timeout in seconds to wait the container to be healthy after creation. Defaults to
60
.- working
Dir String The working directory for commands to run in.
Supporting Types
ContainerCapabilities
ContainerDevice
- Host
Path string The path on the host where the device is located.
- Container
Path 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 string The path on the host where the device is located.
- Container
Path 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 String The path on the host where the device is located.
- container
Path 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 string The path on the host where the device is located.
- container
Path 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
.
- host
Path String The path on the host where the device is located.
- container
Path 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
.- Start
Period 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
.- Start
Period 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<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 Integer
Consecutive failures needed to report unhealthy. Defaults to
0
.- start
Period 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
.- start
Period 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<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
.- start
Period 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
ContainerLabel
ContainerMount
- Target string
Container path
- Type string
The mount type
- Bind
Options ContainerMount Bind Options Optional configuration for the bind type.
- Read
Only bool Whether the mount should be read-only.
- Source string
Mount source (e.g. a volume name, a host path).
- Tmpfs
Options ContainerMount Tmpfs Options Optional configuration for the tmpfs type.
- Volume
Options ContainerMount Volume Options Optional configuration for the volume type.
- Target string
Container path
- Type string
The mount type
- Bind
Options ContainerMount Bind Options Optional configuration for the bind type.
- Read
Only bool Whether the mount should be read-only.
- Source string
Mount source (e.g. a volume name, a host path).
- Tmpfs
Options ContainerMount Tmpfs Options Optional configuration for the tmpfs type.
- Volume
Options ContainerMount Volume Options Optional configuration for the volume type.
- target String
Container path
- type String
The mount type
- bind
Options ContainerMount Bind Options Optional configuration for the bind type.
- read
Only Boolean Whether the mount should be read-only.
- source String
Mount source (e.g. a volume name, a host path).
- tmpfs
Options ContainerMount Tmpfs Options Optional configuration for the tmpfs type.
- volume
Options ContainerMount Volume Options Optional configuration for the volume type.
- target string
Container path
- type string
The mount type
- bind
Options ContainerMount Bind Options Optional configuration for the bind type.
- read
Only boolean Whether the mount should be read-only.
- source string
Mount source (e.g. a volume name, a host path).
- tmpfs
Options ContainerMount Tmpfs Options Optional configuration for the tmpfs type.
- volume
Options ContainerMount Volume Options Optional configuration for the volume type.
- target str
Container path
- type str
The mount type
- bind_
options ContainerMount Bind Options 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 ContainerMount Tmpfs Options Optional configuration for the tmpfs type.
- volume_
options ContainerMount Volume Options Optional configuration for the volume type.
- target String
Container path
- type String
The mount type
- bind
Options Property Map Optional configuration for the bind type.
- read
Only Boolean Whether the mount should be read-only.
- source String
Mount source (e.g. a volume name, a host path).
- tmpfs
Options Property Map Optional configuration for the tmpfs type.
- volume
Options Property Map Optional configuration for the volume type.
ContainerMountBindOptions
- Propagation string
- Propagation string
- propagation String
- propagation string
- propagation str
- propagation String
ContainerMountTmpfsOptions
- mode int
- size_
bytes int
ContainerMountVolumeOptions
- Driver
Name string - Driver
Options Dictionary<string, string> - Labels
List<Container
Mount Volume Options Label> User-defined key/value metadata
- No
Copy bool
- Driver
Name string - Driver
Options map[string]string - Labels
[]Container
Mount Volume Options Label User-defined key/value metadata
- No
Copy bool
- driver
Name String - driver
Options Map<String,String> - labels
List<Container
Mount Volume Options Label> User-defined key/value metadata
- no
Copy Boolean
- driver
Name string - driver
Options {[key: string]: string} - labels
Container
Mount Volume Options Label[] User-defined key/value metadata
- no
Copy boolean
- driver_
name str - driver_
options Mapping[str, str] - labels
Sequence[Container
Mount Volume Options Label] User-defined key/value metadata
- no_
copy bool
- driver
Name String - driver
Options Map<String> - labels List<Property Map>
User-defined key/value metadata
- no
Copy Boolean
ContainerMountVolumeOptionsLabel
ContainerNetworkData
- Gateway string
- Global
Ipv6Address string - Global
Ipv6Prefix intLength - Ip
Address string - Ip
Prefix intLength - Ipv6Gateway string
- Mac
Address string - Network
Name string
- Gateway string
- Global
Ipv6Address string - Global
Ipv6Prefix intLength - Ip
Address string - Ip
Prefix intLength - Ipv6Gateway string
- Mac
Address string - Network
Name string
- gateway String
- global
Ipv6Address String - global
Ipv6Prefix IntegerLength - ip
Address String - ip
Prefix IntegerLength - ipv6Gateway String
- mac
Address String - network
Name String
- gateway string
- global
Ipv6Address string - global
Ipv6Prefix numberLength - ip
Address string - ip
Prefix numberLength - ipv6Gateway string
- mac
Address string - network
Name string
- gateway str
- global_
ipv6_ straddress - global_
ipv6_ intprefix_ length - ip_
address str - ip_
prefix_ intlength - ipv6_
gateway str - mac_
address str - network_
name str
- gateway String
- global
Ipv6Address String - global
Ipv6Prefix NumberLength - ip
Address String - ip
Prefix NumberLength - ipv6Gateway String
- mac
Address String - network
Name String
ContainerNetworksAdvanced
- Name string
The name or id of the network to use. You can use
name
orid
attribute from adocker.Network
resource.- 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 or id of the network to use. You can use
name
orid
attribute from adocker.Network
resource.- 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 or id of the network to use. You can use
name
orid
attribute from adocker.Network
resource.- 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 or id of the network to use. You can use
name
orid
attribute from adocker.Network
resource.- 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 or id of the network to use. You can use
name
orid
attribute from adocker.Network
resource.- 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 or id of the network to use. You can use
name
orid
attribute from adocker.Network
resource.- 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.
ContainerPort
ContainerUlimit
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
- Content
Base64 string - Executable bool
If
true
, the file will be uploaded with user executable permission. Defaults tofalse
.- 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
- Source
Hash 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
- Content
Base64 string - Executable bool
If
true
, the file will be uploaded with user executable permission. Defaults tofalse
.- 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
- Source
Hash 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
- content
Base64 String - executable Boolean
If
true
, the file will be uploaded with user executable permission. Defaults tofalse
.- 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
- source
Hash 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
- content
Base64 string - executable boolean
If
true
, the file will be uploaded with user executable permission. Defaults tofalse
.- 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
- source
Hash 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 tofalse
.- 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
- content
Base64 String - executable Boolean
If
true
, the file will be uploaded with user executable permission. Defaults tofalse
.- 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
- source
Hash String If using
source
, this will force an update if the file content has updated but the filename has not.
ContainerVolume
- Container
Path string The path in the container where the volume will be mounted.
- From
Container string The container where the volume is coming from.
- Host
Path string The path on the host where the volume is coming from.
- Read
Only bool If
true
, this volume will be readonly. Defaults tofalse
.- Volume
Name string The name of the docker volume which should be mounted.
- Container
Path string The path in the container where the volume will be mounted.
- From
Container string The container where the volume is coming from.
- Host
Path string The path on the host where the volume is coming from.
- Read
Only bool If
true
, this volume will be readonly. Defaults tofalse
.- Volume
Name string The name of the docker volume which should be mounted.
- container
Path String The path in the container where the volume will be mounted.
- from
Container String The container where the volume is coming from.
- host
Path String The path on the host where the volume is coming from.
- read
Only Boolean If
true
, this volume will be readonly. Defaults tofalse
.- volume
Name String The name of the docker volume which should be mounted.
- container
Path string The path in the container where the volume will be mounted.
- from
Container string The container where the volume is coming from.
- host
Path string The path on the host where the volume is coming from.
- read
Only boolean If
true
, this volume will be readonly. Defaults tofalse
.- volume
Name 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 tofalse
.- volume_
name str The name of the docker volume which should be mounted.
- container
Path String The path in the container where the volume will be mounted.
- from
Container String The container where the volume is coming from.
- host
Path String The path on the host where the volume is coming from.
- read
Only Boolean If
true
, this volume will be readonly. Defaults tofalse
.- volume
Name 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
- Docker pulumi/pulumi-docker
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
docker
Terraform Provider.