Pulumi Docker

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-docker repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-docker repo.

class pulumi_docker.AwaitableGetNetworkResult(driver=None, id=None, internal=None, ipam_configs=None, name=None, options=None, scope=None)
class pulumi_docker.AwaitableGetRegistryImageResult(id=None, name=None, sha256_digest=None)
class pulumi_docker.CacheFrom

CacheFrom may be used to specify build stages to use for the Docker build cache. The final image is always implicitly included.

stages: Optional[List[pulumi.Input[pulumi.Input[str]]]] = None

An optional list of build stages to use for caching. Each build stage in this list will be built explicitly and pushed to the target repository. A given stage’s image will be tagged as “[stage-name]”.

class pulumi_docker.Container(resource_name, opts=None, attach=None, capabilities=None, command=None, cpu_set=None, cpu_shares=None, destroy_grace_seconds=None, devices=None, dns=None, dns_opts=None, dns_searches=None, domainname=None, entrypoints=None, envs=None, group_adds=None, healthcheck=None, hostname=None, hosts=None, image=None, ipc_mode=None, labels=None, links=None, log_driver=None, log_opts=None, logs=None, max_retry_count=None, memory=None, memory_swap=None, mounts=None, must_run=None, name=None, network_aliases=None, network_mode=None, networks=None, networks_advanced=None, pid_mode=None, ports=None, privileged=None, publish_all_ports=None, read_only=None, restart=None, rm=None, shm_size=None, start=None, sysctls=None, tmpfs=None, ulimits=None, uploads=None, user=None, userns_mode=None, volumes=None, working_dir=None, __props__=None, __name__=None, __opts__=None)

Manages the lifecycle of a Docker container.

import pulumi
import pulumi_docker as docker

# Find the latest Ubuntu precise image.
ubuntu_remote_image = docker.RemoteImage("ubuntuRemoteImage", name="ubuntu:precise")
# Start a container
ubuntu_container = docker.Container("ubuntuContainer", image=ubuntu_remote_image.latest)
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • attach (pulumi.Input[bool]) – If true attach to the container after its creation and waits the end of his execution.

  • capabilities (pulumi.Input[dict]) – See Capabilities below for details.

  • command (pulumi.Input[list]) – The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram", "-f", "baz.conf"].

  • cpu_set (pulumi.Input[str]) – A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1.

  • cpu_shares (pulumi.Input[float]) – CPU shares (relative weight) for the container.

  • destroy_grace_seconds (pulumi.Input[float]) – If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop.

  • devices (pulumi.Input[list]) – See Devices below for details.

  • dns (pulumi.Input[list]) – Set of DNS servers.

  • dns_opts (pulumi.Input[list]) – Set of DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options.

  • dns_searches (pulumi.Input[list]) – Set of DNS search domains that are used when bare unqualified hostnames are used inside of the container.

  • domainname (pulumi.Input[str]) – Domain name of the container.

  • entrypoints (pulumi.Input[list]) – The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be ["/usr/bin/myprogram"].

  • envs (pulumi.Input[list]) – Environment variables to set.

  • group_adds (pulumi.Input[list]) – Add additional groups to run as.

  • healthcheck (pulumi.Input[dict]) – See Healthcheck below for details.

  • hostname (pulumi.Input[str]) – Hostname of the container.

  • hosts (pulumi.Input[list]) – Hostname to add.

  • image (pulumi.Input[str]) – The ID of the image to back this container. The easiest way to get this value is to use the .RemoteImage resource as is shown in the example above.

  • ipc_mode (pulumi.Input[str]) – IPC sharing mode for the container. Possible values are: none, private, shareable, container:<name|id> or host.

  • labels (pulumi.Input[list]) – Adding labels.

  • links (pulumi.Input[list]) – Set of links for link based connectivity between containers that are running on the same host.

  • log_driver (pulumi.Input[str]) – The logging driver to use for the container. Defaults to “json-file”.

  • log_opts (pulumi.Input[dict]) – Key/value pairs to use as options for the logging driver.

  • logs (pulumi.Input[bool]) – Save the container logs (attach must be enabled).

  • max_retry_count (pulumi.Input[float]) – The maximum amount of times to an attempt a restart when restart is set to “on-failure”

  • memory (pulumi.Input[float]) – The memory limit for the container in MBs.

  • mounts (pulumi.Input[list]) – See Mounts below for details.

  • network_aliases (pulumi.Input[list]) – Network aliases of the container for user-defined networks only. Deprecated: use networks_advanced instead.

  • network_mode (pulumi.Input[str]) – Network mode of the container.

  • networks (pulumi.Input[list]) – Id of the networks in which the container is. Deprecated: use networks_advanced instead.

  • networks_advanced (pulumi.Input[list]) – See Networks Advanced below for details. If this block has priority to the deprecated network_alias and network properties.

  • pid_mode (pulumi.Input[str]) – The PID (Process) Namespace mode for the container. Either container:<name|id> or host.

  • ports (pulumi.Input[list]) – See Ports below for details.

  • privileged (pulumi.Input[bool]) – Run container in privileged mode.

  • publish_all_ports (pulumi.Input[bool]) – Publish all ports of the container.

  • read_only (pulumi.Input[bool]) – If true, this volume will be readonly. Defaults to false.

  • restart (pulumi.Input[str]) – The restart policy for the container. Must be one of “no”, “on-failure”, “always”, “unless-stopped”.

  • shm_size (pulumi.Input[float]) – Size of /dev/shm in MBs.

  • start (pulumi.Input[bool]) – If true, then the Docker container will be started after creation. If false, then the container is only created.

  • sysctls (pulumi.Input[dict]) – A map of kernel parameters (sysctls) to set in the container.

  • tmpfs (pulumi.Input[dict]) – A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options.

  • ulimits (pulumi.Input[list]) – See Ulimits below for details.

  • uploads (pulumi.Input[list]) – See File Upload below for details.

  • user (pulumi.Input[str]) – User used for run the first process. Format is user or user:group which user and group can be passed literraly or by name.

  • userns_mode (pulumi.Input[str]) – Sets the usernamespace mode for the container when usernamespace remapping option is enabled.

  • volumes (pulumi.Input[list]) – See Volumes below for details.

  • working_dir (pulumi.Input[str]) – The working directory for commands to run in

The capabilities object supports the following:

  • adds (pulumi.Input[list]) - list of linux capabilities to add.

  • drops (pulumi.Input[list]) - list of linux capabilities to drop.

The devices object supports the following:

  • containerPath (pulumi.Input[str]) - The path in the container where the device will be binded.

  • hostPath (pulumi.Input[str]) - The path on the host where the device is located.

  • permissions (pulumi.Input[str]) - The cgroup permissions given to the container to access the device. Defaults to rwm.

The healthcheck object supports the following:

  • interval (pulumi.Input[str]) - Time between running the check (ms|s|m|h). Default: 0s.

  • retries (pulumi.Input[float]) - Consecutive failures needed to report unhealthy. Default: 0.

  • startPeriod (pulumi.Input[str]) - Start period for the container to initialize before counting retries towards unstable (ms|s|m|h). Default: 0s.

  • tests (pulumi.Input[list]) - Command to run to check health. For example, to run curl -f http://localhost/health set the command to be ["CMD", "curl", "-f", "http://localhost/health"].

  • timeout (pulumi.Input[str]) - Maximum time to allow one check to run (ms|s|m|h). Default: 0s.

The hosts object supports the following:

  • host (pulumi.Input[str]) - Hostname to add.

  • ip (pulumi.Input[str]) - IP address this hostname should resolve to.

The labels object supports the following:

  • label (pulumi.Input[str]) - Name of the label

  • value (pulumi.Input[str]) - Value of the label

The mounts object supports the following:

  • bindOptions (pulumi.Input[dict]) - Optional configuration for the bind type.

    • propagation (pulumi.Input[str]) - A propagation mode with the value.

  • read_only (pulumi.Input[bool]) - If true, this volume will be readonly. Defaults to false.

  • source (pulumi.Input[str]) - The mount source (e.g., a volume name, a host path)

  • target (pulumi.Input[str]) - The container path.

  • tmpfsOptions (pulumi.Input[dict]) - Optional configuration for the tmpf type.

    • mode (pulumi.Input[float]) - The permission mode for the tmpfs mount in an integer.

    • sizeBytes (pulumi.Input[float]) - The size for the tmpfs mount in bytes.

  • type (pulumi.Input[str]) - The mount type: valid values are bind|volume|tmpfs.

  • volumeOptions (pulumi.Input[dict]) - Optional configuration for the volume type.

    • driverName (pulumi.Input[str])

    • driverOptions (pulumi.Input[dict]) - Options for the driver.

    • labels (pulumi.Input[list]) - Adding labels.

      • label (pulumi.Input[str]) - Name of the label

      • value (pulumi.Input[str]) - Value of the label

    • noCopy (pulumi.Input[bool]) - Whether to populate volume with data from the target.

The networks_advanced object supports the following:

  • aliases (pulumi.Input[list]) - The network aliases of the container in the specific network.

  • ipv4Address (pulumi.Input[str]) - The IPV4 address of the container in the specific network.

  • ipv6Address (pulumi.Input[str]) - The IPV6 address of the container in the specific network.

  • name (pulumi.Input[str]) - The name of the network.

The ports object supports the following:

  • external (pulumi.Input[float]) - Port exposed out of the container. If not given a free random port >= 32768 will be used.

  • internal (pulumi.Input[float]) - Port within the container.

  • ip (pulumi.Input[str]) - IP address this hostname should resolve to.

  • protocol (pulumi.Input[str]) - Protocol that can be used over this port, defaults to tcp.

The ulimits object supports the following:

  • hard (pulumi.Input[float])

  • name (pulumi.Input[str])

  • soft (pulumi.Input[float])

The uploads object supports the following:

  • content (pulumi.Input[str]) - Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.

  • contentBase64 (pulumi.Input[str])

  • executable (pulumi.Input[bool]) - If true, the file will be uploaded with user executable permission. Defaults to false.

  • file (pulumi.Input[str]) - path to a file in the container.

  • source (pulumi.Input[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.

  • sourceHash (pulumi.Input[str]) - If using source, this will force an update if the file content has updated but the filename has not.

The volumes object supports the following:

  • containerPath (pulumi.Input[str]) - The path in the container where the device will be binded.

  • fromContainer (pulumi.Input[str]) - The container where the volume is coming from.

  • hostPath (pulumi.Input[str]) - The path on the host where the device is located.

  • read_only (pulumi.Input[bool]) - If true, this volume will be readonly. Defaults to false.

  • volumeName (pulumi.Input[str]) - The name of the docker volume which should be mounted.

attach: pulumi.Output[bool] = None

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

bridge: pulumi.Output[str] = None

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

capabilities: pulumi.Output[dict] = None

See Capabilities below for details.

  • adds (list) - list of linux capabilities to add.

  • drops (list) - list of linux capabilities to drop.

command: pulumi.Output[list] = None

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.conf"].

container_logs: pulumi.Output[str] = None

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

cpu_set: pulumi.Output[str] = None

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

cpu_shares: pulumi.Output[float] = None

CPU shares (relative weight) for the container.

destroy_grace_seconds: pulumi.Output[float] = None

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

devices: pulumi.Output[list] = None

See Devices below for details.

  • containerPath (str) - The path in the container where the device will be binded.

  • hostPath (str) - The path on the host where the device is located.

  • permissions (str) - The cgroup permissions given to the container to access the device. Defaults to rwm.

dns: pulumi.Output[list] = None

Set of DNS servers.

dns_opts: pulumi.Output[list] = None

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

dns_searches: pulumi.Output[list] = None

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

domainname: pulumi.Output[str] = None

Domain name of the container.

entrypoints: pulumi.Output[list] = None

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/myprogram"].

envs: pulumi.Output[list] = None

Environment variables to set.

exit_code: pulumi.Output[float] = None

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

gateway: pulumi.Output[str] = None

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

group_adds: pulumi.Output[list] = None

Add additional groups to run as.

healthcheck: pulumi.Output[dict] = None

See Healthcheck below for details.

  • interval (str) - Time between running the check (ms|s|m|h). Default: 0s.

  • retries (float) - Consecutive failures needed to report unhealthy. Default: 0.

  • startPeriod (str) - Start period for the container to initialize before counting retries towards unstable (ms|s|m|h). Default: 0s.

  • tests (list) - Command to run to check health. For example, to run curl -f http://localhost/health set the command to be ["CMD", "curl", "-f", "http://localhost/health"].

  • timeout (str) - Maximum time to allow one check to run (ms|s|m|h). Default: 0s.

hostname: pulumi.Output[str] = None

Hostname of the container.

hosts: pulumi.Output[list] = None

Hostname to add.

  • host (str) - Hostname to add.

  • ip (str) - IP address this hostname should resolve to.

image: pulumi.Output[str] = None

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

ip_address: pulumi.Output[str] = None

Deprecated: Use network_data instead. The IP address of the container’s first network it.

ip_prefix_length: pulumi.Output[float] = None

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

ipc_mode: pulumi.Output[str] = None

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

labels: pulumi.Output[list] = None

Adding labels.

  • label (str) - Name of the label

  • value (str) - Value of the label

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

log_driver: pulumi.Output[str] = None

The logging driver to use for the container. Defaults to “json-file”.

log_opts: pulumi.Output[dict] = None

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

logs: pulumi.Output[bool] = None

Save the container logs (attach must be enabled).

max_retry_count: pulumi.Output[float] = None

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

memory: pulumi.Output[float] = None

The memory limit for the container in MBs.

mounts: pulumi.Output[list] = None

See Mounts below for details.

  • bindOptions (dict) - Optional configuration for the bind type.

    • propagation (str) - A propagation mode with the value.

  • read_only (bool) - If true, this volume will be readonly. Defaults to false.

  • source (str) - The mount source (e.g., a volume name, a host path)

  • target (str) - The container path.

  • tmpfsOptions (dict) - Optional configuration for the tmpf type.

    • mode (float) - The permission mode for the tmpfs mount in an integer.

    • sizeBytes (float) - The size for the tmpfs mount in bytes.

  • type (str) - The mount type: valid values are bind|volume|tmpfs.

  • volumeOptions (dict) - Optional configuration for the volume type.

    • driverName (str)

    • driverOptions (dict) - Options for the driver.

    • labels (list) - Adding labels.

      • label (str) - Name of the label

      • value (str) - Value of the label

    • noCopy (bool) - Whether to populate volume with data from the target.

network_aliases: pulumi.Output[list] = None

Network aliases of the container for user-defined networks only. Deprecated: use networks_advanced instead.

network_datas: pulumi.Output[list] = None

(Map of a block) The IP addresses of the container on each network. Key are the network names, values are the IP addresses.

  • gateway (str) - Deprecated: Use network_data instead. The network gateway of the container as read from its NetworkSettings.

  • ip_address (str) - Deprecated: Use network_data instead. The IP address of the container’s first network it.

  • ip_prefix_length (float) - Deprecated: Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

  • networkName (str)

network_mode: pulumi.Output[str] = None

Network mode of the container.

networks: pulumi.Output[list] = None

Id of the networks in which the container is. Deprecated: use networks_advanced instead.

networks_advanced: pulumi.Output[list] = None

See Networks Advanced below for details. If this block has priority to the deprecated network_alias and network properties.

  • aliases (list) - The network aliases of the container in the specific network.

  • ipv4Address (str) - The IPV4 address of the container in the specific network.

  • ipv6Address (str) - The IPV6 address of the container in the specific network.

  • name (str) - The name of the network.

pid_mode: pulumi.Output[str] = None

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

ports: pulumi.Output[list] = None

See Ports below for details.

  • external (float) - Port exposed out of the container. If not given a free random port >= 32768 will be used.

  • internal (float) - Port within the container.

  • ip (str) - IP address this hostname should resolve to.

  • protocol (str) - Protocol that can be used over this port, defaults to tcp.

privileged: pulumi.Output[bool] = None

Run container in privileged mode.

publish_all_ports: pulumi.Output[bool] = None

Publish all ports of the container.

read_only: pulumi.Output[bool] = None

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

restart: pulumi.Output[str] = None

The restart policy for the container. Must be one of “no”, “on-failure”, “always”, “unless-stopped”.

shm_size: pulumi.Output[float] = None

Size of /dev/shm in MBs.

start: pulumi.Output[bool] = None

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

sysctls: pulumi.Output[dict] = None

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

tmpfs: pulumi.Output[dict] = None

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

ulimits: pulumi.Output[list] = None

See Ulimits below for details.

  • hard (float)

  • name (str)

  • soft (float)

uploads: pulumi.Output[list] = None

See File Upload below for details.

  • content (str) - Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.

  • contentBase64 (str)

  • executable (bool) - If true, the file will be uploaded with user executable permission. Defaults to false.

  • file (str) - path to a file in the container.

  • 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.

  • sourceHash (str) - If using source, this will force an update if the file content has updated but the filename has not.

user: pulumi.Output[str] = None

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

userns_mode: pulumi.Output[str] = None

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

volumes: pulumi.Output[list] = None

See Volumes below for details.

  • containerPath (str) - The path in the container where the device will be binded.

  • fromContainer (str) - The container where the volume is coming from.

  • hostPath (str) - The path on the host where the device is located.

  • read_only (bool) - If true, this volume will be readonly. Defaults to false.

  • volumeName (str) - The name of the docker volume which should be mounted.

working_dir: pulumi.Output[str] = None

The working directory for commands to run in

static get(resource_name, id, opts=None, attach=None, bridge=None, capabilities=None, command=None, container_logs=None, cpu_set=None, cpu_shares=None, destroy_grace_seconds=None, devices=None, dns=None, dns_opts=None, dns_searches=None, domainname=None, entrypoints=None, envs=None, exit_code=None, gateway=None, group_adds=None, healthcheck=None, hostname=None, hosts=None, image=None, ip_address=None, ip_prefix_length=None, ipc_mode=None, labels=None, links=None, log_driver=None, log_opts=None, logs=None, max_retry_count=None, memory=None, memory_swap=None, mounts=None, must_run=None, name=None, network_aliases=None, network_datas=None, network_mode=None, networks=None, networks_advanced=None, pid_mode=None, ports=None, privileged=None, publish_all_ports=None, read_only=None, restart=None, rm=None, shm_size=None, start=None, sysctls=None, tmpfs=None, ulimits=None, uploads=None, user=None, userns_mode=None, volumes=None, working_dir=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • attach (pulumi.Input[bool]) – If true attach to the container after its creation and waits the end of his execution.

  • bridge (pulumi.Input[str]) – The network bridge of the container as read from its NetworkSettings.

  • capabilities (pulumi.Input[dict]) – See Capabilities below for details.

  • command (pulumi.Input[list]) – The command to use to start the container. For example, to run /usr/bin/myprogram -f baz.conf set the command to be ["/usr/bin/myprogram", "-f", "baz.conf"].

  • container_logs (pulumi.Input[str]) – The logs of the container if its execution is done (attach must be disabled).

  • cpu_set (pulumi.Input[str]) – A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. 0-1.

  • cpu_shares (pulumi.Input[float]) – CPU shares (relative weight) for the container.

  • destroy_grace_seconds (pulumi.Input[float]) – If defined will attempt to stop the container before destroying. Container will be destroyed after n seconds or on successful stop.

  • devices (pulumi.Input[list]) – See Devices below for details.

  • dns (pulumi.Input[list]) – Set of DNS servers.

  • dns_opts (pulumi.Input[list]) – Set of DNS options used by the DNS provider(s), see resolv.conf documentation for valid list of options.

  • dns_searches (pulumi.Input[list]) – Set of DNS search domains that are used when bare unqualified hostnames are used inside of the container.

  • domainname (pulumi.Input[str]) – Domain name of the container.

  • entrypoints (pulumi.Input[list]) – The command to use as the Entrypoint for the container. The Entrypoint allows you to configure a container to run as an executable. For example, to run /usr/bin/myprogram when starting a container, set the entrypoint to be ["/usr/bin/myprogram"].

  • envs (pulumi.Input[list]) – Environment variables to set.

  • exit_code (pulumi.Input[float]) – The exit code of the container if its execution is done (must_run must be disabled).

  • gateway (pulumi.Input[str]) – Deprecated: Use network_data instead. The network gateway of the container as read from its NetworkSettings.

  • group_adds (pulumi.Input[list]) – Add additional groups to run as.

  • healthcheck (pulumi.Input[dict]) – See Healthcheck below for details.

  • hostname (pulumi.Input[str]) – Hostname of the container.

  • hosts (pulumi.Input[list]) – Hostname to add.

  • image (pulumi.Input[str]) – The ID of the image to back this container. The easiest way to get this value is to use the .RemoteImage resource as is shown in the example above.

  • ip_address (pulumi.Input[str]) – Deprecated: Use network_data instead. The IP address of the container’s first network it.

  • ip_prefix_length (pulumi.Input[float]) – Deprecated: Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

  • ipc_mode (pulumi.Input[str]) – IPC sharing mode for the container. Possible values are: none, private, shareable, container:<name|id> or host.

  • labels (pulumi.Input[list]) – Adding labels.

  • links (pulumi.Input[list]) – Set of links for link based connectivity between containers that are running on the same host.

  • log_driver (pulumi.Input[str]) – The logging driver to use for the container. Defaults to “json-file”.

  • log_opts (pulumi.Input[dict]) – Key/value pairs to use as options for the logging driver.

  • logs (pulumi.Input[bool]) – Save the container logs (attach must be enabled).

  • max_retry_count (pulumi.Input[float]) – The maximum amount of times to an attempt a restart when restart is set to “on-failure”

  • memory (pulumi.Input[float]) – The memory limit for the container in MBs.

  • mounts (pulumi.Input[list]) – See Mounts below for details.

  • network_aliases (pulumi.Input[list]) – Network aliases of the container for user-defined networks only. Deprecated: use networks_advanced instead.

  • network_datas (pulumi.Input[list]) – (Map of a block) The IP addresses of the container on each network. Key are the network names, values are the IP addresses.

  • network_mode (pulumi.Input[str]) – Network mode of the container.

  • networks (pulumi.Input[list]) – Id of the networks in which the container is. Deprecated: use networks_advanced instead.

  • networks_advanced (pulumi.Input[list]) – See Networks Advanced below for details. If this block has priority to the deprecated network_alias and network properties.

  • pid_mode (pulumi.Input[str]) – The PID (Process) Namespace mode for the container. Either container:<name|id> or host.

  • ports (pulumi.Input[list]) – See Ports below for details.

  • privileged (pulumi.Input[bool]) – Run container in privileged mode.

  • publish_all_ports (pulumi.Input[bool]) – Publish all ports of the container.

  • read_only (pulumi.Input[bool]) – If true, this volume will be readonly. Defaults to false.

  • restart (pulumi.Input[str]) – The restart policy for the container. Must be one of “no”, “on-failure”, “always”, “unless-stopped”.

  • shm_size (pulumi.Input[float]) – Size of /dev/shm in MBs.

  • start (pulumi.Input[bool]) – If true, then the Docker container will be started after creation. If false, then the container is only created.

  • sysctls (pulumi.Input[dict]) – A map of kernel parameters (sysctls) to set in the container.

  • tmpfs (pulumi.Input[dict]) – A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options.

  • ulimits (pulumi.Input[list]) – See Ulimits below for details.

  • uploads (pulumi.Input[list]) – See File Upload below for details.

  • user (pulumi.Input[str]) – User used for run the first process. Format is user or user:group which user and group can be passed literraly or by name.

  • userns_mode (pulumi.Input[str]) – Sets the usernamespace mode for the container when usernamespace remapping option is enabled.

  • volumes (pulumi.Input[list]) – See Volumes below for details.

  • working_dir (pulumi.Input[str]) – The working directory for commands to run in

The capabilities object supports the following:

  • adds (pulumi.Input[list]) - list of linux capabilities to add.

  • drops (pulumi.Input[list]) - list of linux capabilities to drop.

The devices object supports the following:

  • containerPath (pulumi.Input[str]) - The path in the container where the device will be binded.

  • hostPath (pulumi.Input[str]) - The path on the host where the device is located.

  • permissions (pulumi.Input[str]) - The cgroup permissions given to the container to access the device. Defaults to rwm.

The healthcheck object supports the following:

  • interval (pulumi.Input[str]) - Time between running the check (ms|s|m|h). Default: 0s.

  • retries (pulumi.Input[float]) - Consecutive failures needed to report unhealthy. Default: 0.

  • startPeriod (pulumi.Input[str]) - Start period for the container to initialize before counting retries towards unstable (ms|s|m|h). Default: 0s.

  • tests (pulumi.Input[list]) - Command to run to check health. For example, to run curl -f http://localhost/health set the command to be ["CMD", "curl", "-f", "http://localhost/health"].

  • timeout (pulumi.Input[str]) - Maximum time to allow one check to run (ms|s|m|h). Default: 0s.

The hosts object supports the following:

  • host (pulumi.Input[str]) - Hostname to add.

  • ip (pulumi.Input[str]) - IP address this hostname should resolve to.

The labels object supports the following:

  • label (pulumi.Input[str]) - Name of the label

  • value (pulumi.Input[str]) - Value of the label

The mounts object supports the following:

  • bindOptions (pulumi.Input[dict]) - Optional configuration for the bind type.

    • propagation (pulumi.Input[str]) - A propagation mode with the value.

  • read_only (pulumi.Input[bool]) - If true, this volume will be readonly. Defaults to false.

  • source (pulumi.Input[str]) - The mount source (e.g., a volume name, a host path)

  • target (pulumi.Input[str]) - The container path.

  • tmpfsOptions (pulumi.Input[dict]) - Optional configuration for the tmpf type.

    • mode (pulumi.Input[float]) - The permission mode for the tmpfs mount in an integer.

    • sizeBytes (pulumi.Input[float]) - The size for the tmpfs mount in bytes.

  • type (pulumi.Input[str]) - The mount type: valid values are bind|volume|tmpfs.

  • volumeOptions (pulumi.Input[dict]) - Optional configuration for the volume type.

    • driverName (pulumi.Input[str])

    • driverOptions (pulumi.Input[dict]) - Options for the driver.

    • labels (pulumi.Input[list]) - Adding labels.

      • label (pulumi.Input[str]) - Name of the label

      • value (pulumi.Input[str]) - Value of the label

    • noCopy (pulumi.Input[bool]) - Whether to populate volume with data from the target.

The network_datas object supports the following:

  • gateway (pulumi.Input[str]) - Deprecated: Use network_data instead. The network gateway of the container as read from its NetworkSettings.

  • ip_address (pulumi.Input[str]) - Deprecated: Use network_data instead. The IP address of the container’s first network it.

  • ip_prefix_length (pulumi.Input[float]) - Deprecated: Use network_data instead. The IP prefix length of the container as read from its NetworkSettings.

  • networkName (pulumi.Input[str])

The networks_advanced object supports the following:

  • aliases (pulumi.Input[list]) - The network aliases of the container in the specific network.

  • ipv4Address (pulumi.Input[str]) - The IPV4 address of the container in the specific network.

  • ipv6Address (pulumi.Input[str]) - The IPV6 address of the container in the specific network.

  • name (pulumi.Input[str]) - The name of the network.

The ports object supports the following:

  • external (pulumi.Input[float]) - Port exposed out of the container. If not given a free random port >= 32768 will be used.

  • internal (pulumi.Input[float]) - Port within the container.

  • ip (pulumi.Input[str]) - IP address this hostname should resolve to.

  • protocol (pulumi.Input[str]) - Protocol that can be used over this port, defaults to tcp.

The ulimits object supports the following:

  • hard (pulumi.Input[float])

  • name (pulumi.Input[str])

  • soft (pulumi.Input[float])

The uploads object supports the following:

  • content (pulumi.Input[str]) - Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.

  • contentBase64 (pulumi.Input[str])

  • executable (pulumi.Input[bool]) - If true, the file will be uploaded with user executable permission. Defaults to false.

  • file (pulumi.Input[str]) - path to a file in the container.

  • source (pulumi.Input[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.

  • sourceHash (pulumi.Input[str]) - If using source, this will force an update if the file content has updated but the filename has not.

The volumes object supports the following:

  • containerPath (pulumi.Input[str]) - The path in the container where the device will be binded.

  • fromContainer (pulumi.Input[str]) - The container where the volume is coming from.

  • hostPath (pulumi.Input[str]) - The path on the host where the device is located.

  • read_only (pulumi.Input[bool]) - If true, this volume will be readonly. Defaults to false.

  • volumeName (pulumi.Input[str]) - The name of the docker volume which should be mounted.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

exception pulumi_docker.Error
class pulumi_docker.GetNetworkResult(driver=None, id=None, internal=None, ipam_configs=None, name=None, options=None, scope=None)

A collection of values returned by getNetwork.

driver = None

(Optional, string) The driver of the Docker network. Possible values are bridge, host, overlay, macvlan. See [docker docs][networkdocs] for more details.

options = None

(Optional, map) Only available with bridge networks. See [docker docs][bridgeoptionsdocs] for more details.

  • internal (Optional, bool) Boolean flag for whether the network is internal.

  • ipam_config (Optional, map) See IPAM below for details.

  • scope (Optional, string) Scope of the network. One of swarm, global, or local.

class pulumi_docker.GetRegistryImageResult(id=None, name=None, sha256_digest=None)

A collection of values returned by getRegistryImage.

id = None

The provider-assigned unique ID for this managed resource.

class pulumi_docker.Image(name: str, image_name: Union[str, Awaitable[str], Output[T]], build: Union[str, Awaitable[str], Output[T], pulumi_docker.docker.DockerBuild], local_image_name: Union[str, Awaitable[str], Output[T], None] = None, registry: Union[pulumi_docker.image.ImageRegistry, Awaitable[pulumi_docker.image.ImageRegistry], Output[T], None] = None, skip_push: Optional[bool] = None, opts: Optional[pulumi.resource.ResourceOptions] = None)

A docker.Image resource represents a Docker image built locally which is published and made available via a remote Docker registry. This can be used to ensure that a Docker source directory from a local deployment environment is built and pushed to a cloud-hosted Docker registry as part of a Pulumi deployment, so that it can be referenced as an image input from other cloud services that reference Docker images - including Kubernetes Pods, AWS ECS Tasks, and Azure Container Instances.

Parameters
  • name (str) – The name of the resource.

  • image_name (pulumi.Input[str]) – The qualified image name that will be pushed to the remote registry. Must be a supported image name for the target registry user. This name can include a tag at the end. If provided all pushed image resources will contain that tag as well. Either [imageName] or [localImageName] can have a tag. However, if both have a tag, then those tags must match.

  • DockerBuild] build (Union[pulumi.Input[str],) – The Docker build context, as a folder path or a detailed DockerBuild object.

  • local_image_name (Optional[pulumi.Input[str]]) – The docker image name to build locally before tagging with imageName. If not provided, it will be given the value of to [imageName]. This name can include a tag at the end. If provided all pushed image resources will contain that tag as well. Either [imageName] or [localImageName] can have a tag. However, if both have a tag, then those tags must match.

  • registry (Optional[pulumi.Input[ImageRegistry]]) – Credentials for the docker registry to push to.

  • skip_push (Optional[bool]) – Skip push flag.

  • opts (Optional[pulumi.ResourceOptions]) – Options for the resource.

image_name: pulumi.Output[str] = None

The unique pinned image name on the remote repository.

registry_server: pulumi.Output[Optional[str]] = None

The server the image is located at.

base_image_name: pulumi.Output[str] = None

The base image name that was built and pushed. This does not include the id annotation, so is not pinned to the specific build performed by this docker.Image.

class pulumi_docker.LooseVersion(vstring=None)

Version numbering for anarchists and software realists. Implements the standard interface for version number classes as described above. A version number consists of a series of numbers, separated by either periods or strings of letters. When comparing version numbers, the numeric components will be compared numerically, and the alphabetic components lexically. The following are all valid version numbers, in no particular order:

1.5.1
1.5.2b2
161
3.10a
8.02
3.4j
1996.07.12
3.2.pl0
3.1.1.6
2g6
11g
0.960923
2.2beta29
1.13++
5.5.kw
2.0b1pl0

In fact, there is no such thing as an invalid version number under this scheme; the rules for comparison are simple and predictable, but may not always give the results you want (for some definition of “want”).

class pulumi_docker.Network(resource_name, opts=None, attachable=None, check_duplicate=None, driver=None, ingress=None, internal=None, ipam_configs=None, ipam_driver=None, ipv6=None, labels=None, name=None, options=None, __props__=None, __name__=None, __opts__=None)

Manages a Docker Network. This can be used alongside docker_container to create virtual networks within the docker environment.

import pulumi
import pulumi_docker as docker

# Create a new docker network
private_network = docker.Network("privateNetwork")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • attachable (pulumi.Input[bool]) – Enable manual container attachment to the network. Defaults to false.

  • check_duplicate (pulumi.Input[bool]) – Requests daemon to check for networks with same name.

  • driver (pulumi.Input[str]) – Name of the network driver to use. Defaults to bridge driver.

  • ingress (pulumi.Input[bool]) – Create swarm routing-mesh network. Defaults to false.

  • internal (pulumi.Input[bool]) – Restrict external access to the network. Defaults to false.

  • ipam_configs (pulumi.Input[list]) – See IPAM config below for details.

  • ipam_driver (pulumi.Input[str]) – Driver used by the custom IP scheme of the network.

  • ipv6 (pulumi.Input[bool]) – Enable IPv6 networking. Defaults to false.

  • labels (pulumi.Input[list]) – See Labels below for details.

  • name (pulumi.Input[str]) – The name of the Docker network.

  • options (pulumi.Input[dict]) – Network specific options to be used by the drivers.

The ipam_configs object supports the following:

  • auxAddress (pulumi.Input[dict])

  • gateway (pulumi.Input[str])

  • ipRange (pulumi.Input[str])

  • subnet (pulumi.Input[str])

The labels object supports the following:

  • label (pulumi.Input[str]) - Name of the label

  • value (pulumi.Input[str]) - Value of the label

attachable: pulumi.Output[bool] = None

Enable manual container attachment to the network. Defaults to false.

check_duplicate: pulumi.Output[bool] = None

Requests daemon to check for networks with same name.

driver: pulumi.Output[str] = None

Name of the network driver to use. Defaults to bridge driver.

ingress: pulumi.Output[bool] = None

Create swarm routing-mesh network. Defaults to false.

internal: pulumi.Output[bool] = None

Restrict external access to the network. Defaults to false.

ipam_configs: pulumi.Output[list] = None

See IPAM config below for details.

  • auxAddress (dict)

  • gateway (str)

  • ipRange (str)

  • subnet (str)

ipam_driver: pulumi.Output[str] = None

Driver used by the custom IP scheme of the network.

ipv6: pulumi.Output[bool] = None

Enable IPv6 networking. Defaults to false.

labels: pulumi.Output[list] = None

See Labels below for details.

  • label (str) - Name of the label

  • value (str) - Value of the label

name: pulumi.Output[str] = None

The name of the Docker network.

options: pulumi.Output[dict] = None

Network specific options to be used by the drivers.

static get(resource_name, id, opts=None, attachable=None, check_duplicate=None, driver=None, ingress=None, internal=None, ipam_configs=None, ipam_driver=None, ipv6=None, labels=None, name=None, options=None, scope=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • attachable (pulumi.Input[bool]) – Enable manual container attachment to the network. Defaults to false.

  • check_duplicate (pulumi.Input[bool]) – Requests daemon to check for networks with same name.

  • driver (pulumi.Input[str]) – Name of the network driver to use. Defaults to bridge driver.

  • ingress (pulumi.Input[bool]) – Create swarm routing-mesh network. Defaults to false.

  • internal (pulumi.Input[bool]) – Restrict external access to the network. Defaults to false.

  • ipam_configs (pulumi.Input[list]) – See IPAM config below for details.

  • ipam_driver (pulumi.Input[str]) – Driver used by the custom IP scheme of the network.

  • ipv6 (pulumi.Input[bool]) – Enable IPv6 networking. Defaults to false.

  • labels (pulumi.Input[list]) – See Labels below for details.

  • name (pulumi.Input[str]) – The name of the Docker network.

  • options (pulumi.Input[dict]) – Network specific options to be used by the drivers.

The ipam_configs object supports the following:

  • auxAddress (pulumi.Input[dict])

  • gateway (pulumi.Input[str])

  • ipRange (pulumi.Input[str])

  • subnet (pulumi.Input[str])

The labels object supports the following:

  • label (pulumi.Input[str]) - Name of the label

  • value (pulumi.Input[str]) - Value of the label

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_docker.Provider(resource_name, opts=None, ca_material=None, cert_material=None, cert_path=None, host=None, key_material=None, registry_auth=None, __props__=None, __name__=None, __opts__=None)

The provider type for the docker package. By default, resources use package-wide configuration settings, however an explicit Provider instance may be created and passed during resource construction to achieve fine-grained programmatic control over provider settings. See the documentation for more information.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • ca_material (pulumi.Input[str]) – PEM-encoded content of Docker host CA certificate

  • cert_material (pulumi.Input[str]) – PEM-encoded content of Docker client certificate

  • cert_path (pulumi.Input[str]) – Path to directory with Docker TLS config

  • host (pulumi.Input[str]) – The Docker daemon address

  • key_material (pulumi.Input[str]) – PEM-encoded content of Docker client private key

The registry_auth object supports the following:

  • address (pulumi.Input[str])

  • configFile (pulumi.Input[str])

  • configFileContent (pulumi.Input[str])

  • password (pulumi.Input[str])

  • username (pulumi.Input[str])

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_docker.RemoteImage(resource_name, opts=None, keep_locally=None, name=None, pull_trigger=None, pull_triggers=None, __props__=None, __name__=None, __opts__=None)

Pulls a Docker image to a given Docker host from a Docker Registry.

This resource will not pull new layers of the image automatically unless used in conjunction with `.getRegistryImage`` <https://www.terraform.io/docs/providers/docker/d/registry_image.html>`_ data source to update the pull_triggers field.

import pulumi
import pulumi_docker as docker

# Find the latest Ubuntu precise image.
ubuntu = docker.RemoteImage("ubuntu", name="ubuntu:precise")
import pulumi
import pulumi_docker as docker

ubuntu_registry_image = docker.get_registry_image(name="ubuntu:precise")
ubuntu_remote_image = docker.RemoteImage("ubuntuRemoteImage",
    name=ubuntu_registry_image.name,
    pull_triggers=[ubuntu_registry_image.sha256_digest])
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • keep_locally (pulumi.Input[bool]) – If true, then the Docker image won’t be deleted on destroy operation. If this is false, it will delete the image from the docker local storage on destroy operation.

  • name (pulumi.Input[str]) – The name of the Docker image, including any tags or SHA256 repo digests.

  • pull_trigger (pulumi.Input[str]) – Deprecated, use pull_triggers instead.

  • pull_triggers (pulumi.Input[list]) – List of values which cause an image pull when changed. This is used to store the image digest from the registry when using the .getRegistryImage data source to trigger an image update.

keep_locally: pulumi.Output[bool] = None

If true, then the Docker image won’t be deleted on destroy operation. If this is false, it will delete the image from the docker local storage on destroy operation.

name: pulumi.Output[str] = None

The name of the Docker image, including any tags or SHA256 repo digests.

pull_trigger: pulumi.Output[str] = None

Deprecated, use pull_triggers instead.

pull_triggers: pulumi.Output[list] = None

List of values which cause an image pull when changed. This is used to store the image digest from the registry when using the .getRegistryImage data source to trigger an image update.

static get(resource_name, id, opts=None, keep_locally=None, latest=None, name=None, pull_trigger=None, pull_triggers=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • keep_locally (pulumi.Input[bool]) – If true, then the Docker image won’t be deleted on destroy operation. If this is false, it will delete the image from the docker local storage on destroy operation.

  • name (pulumi.Input[str]) – The name of the Docker image, including any tags or SHA256 repo digests.

  • pull_trigger (pulumi.Input[str]) – Deprecated, use pull_triggers instead.

  • pull_triggers (pulumi.Input[list]) –

    List of values which cause an image pull when changed. This is used to store the image digest from the registry when using the .getRegistryImage data source to trigger an image update.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

exception pulumi_docker.ResourceError(message: str, resource: Optional[pulumi.resource.Resource], hide_stack: Optional[bool] = False)
class pulumi_docker.Secret(resource_name, opts=None, data=None, labels=None, name=None, __props__=None, __name__=None, __opts__=None)

Manages the secrets of a Docker service in a swarm.

import pulumi
import pulumi_docker as docker

# Creates a secret
foo_secret = docker.Secret("fooSecret", data="ewogICJzZXJsaasIfQo=")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • data (pulumi.Input[str]) – The base64 encoded data of the secret.

  • labels (pulumi.Input[list]) – See Labels below for details.

  • name (pulumi.Input[str]) – The name of the Docker secret.

The labels object supports the following:

  • label (pulumi.Input[str]) - Name of the label

  • value (pulumi.Input[str]) - Value of the label

data: pulumi.Output[str] = None

The base64 encoded data of the secret.

labels: pulumi.Output[list] = None

See Labels below for details.

  • label (str) - Name of the label

  • value (str) - Value of the label

name: pulumi.Output[str] = None

The name of the Docker secret.

static get(resource_name, id, opts=None, data=None, labels=None, name=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • data (pulumi.Input[str]) – The base64 encoded data of the secret.

  • labels (pulumi.Input[list]) – See Labels below for details.

  • name (pulumi.Input[str]) – The name of the Docker secret.

The labels object supports the following:

  • label (pulumi.Input[str]) - Name of the label

  • value (pulumi.Input[str]) - Value of the label

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_docker.Service(resource_name, opts=None, auth=None, converge_config=None, endpoint_spec=None, labels=None, mode=None, name=None, rollback_config=None, task_spec=None, update_config=None, __props__=None, __name__=None, __opts__=None)

Create a Service resource with the given unique name, props, and options. :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[dict] auth: See Auth below for details. :param pulumi.Input[dict] converge_config: See Converge Config below for details. :param pulumi.Input[dict] endpoint_spec: See EndpointSpec below for details. :param pulumi.Input[list] labels: See Labels below for details. :param pulumi.Input[dict] mode: See Mode below for details. :param pulumi.Input[str] name: The name of the Docker service. :param pulumi.Input[dict] rollback_config: See RollbackConfig below for details. :param pulumi.Input[dict] task_spec: See TaskSpec below for details. :param pulumi.Input[dict] update_config: See UpdateConfig below for details.

The auth object supports the following:

  • password (pulumi.Input[str]) - The password to use for authenticating to the registry. If this is blank, the DOCKER_REGISTRY_PASS is also be checked.

  • server_address (pulumi.Input[str]) - The address of the registry server

  • username (pulumi.Input[str]) - The username to use for authenticating to the registry. If this is blank, the DOCKER_REGISTRY_USER is also be checked.

The converge_config object supports the following:

  • delay (pulumi.Input[str]) - Time between each the check to check docker endpoint (ms|s|m|h). For example, to check if all tasks are up when a service is created, or to check if all tasks are successfully updated on an update. Default: 7s.

  • timeout (pulumi.Input[str]) - The timeout of the service to reach the desired state (s|m). Default: 3m.

The endpoint_spec object supports the following:

  • mode (pulumi.Input[str]) - The mode of resolution to use for internal load balancing between tasks. (vip|dnsrr). Default: vip.

  • ports (pulumi.Input[list]) - See Ports below for details.

    • name (pulumi.Input[str]) - The name of the Docker service.

    • protocol (pulumi.Input[str]) - Protocol that can be used over this port: tcp|udp|sctp. Default: tcp.

    • publishMode (pulumi.Input[str]) - Represents the mode in which the port is to be published: ingress|host

    • publishedPort (pulumi.Input[float]) - The port on the swarm hosts. If not set the value of target_port will be used.

    • targetPort (pulumi.Input[float]) - Port inside the container.

The labels object supports the following:

  • label (pulumi.Input[str]) - Name of the label

  • value (pulumi.Input[str]) - Value of the label

The mode object supports the following:

  • global (pulumi.Input[bool]) - set it to true to run the service in the global mode

  • replicated (pulumi.Input[dict]) - , which contains atm only the amount of replicas

    • replicas (pulumi.Input[float])

The rollback_config object supports the following:

  • delay (pulumi.Input[str]) - Delay between restart attempts (ms|s|m|h) all tasks are up when a service is created, or to check if all tasks are successfully updated on an update. Default: 7s.

  • failureAction (pulumi.Input[str]) - Action on update failure: pause|continue|rollback.

  • maxFailureRatio (pulumi.Input[str]) - The failure rate to tolerate during an update as float. Important: the floatneed to be wrapped in a string to avoid internal casting and precision errors.

  • monitor (pulumi.Input[str]) - Duration after each task update to monitor for failure (ns|us|ms|s|m|h)

  • order (pulumi.Input[str]) - Update order either ‘stop-first’ or ‘start-first’.

  • parallelism (pulumi.Input[float]) - The maximum number of tasks to be updated in one iteration simultaneously (0 to update all at once).

The task_spec object supports the following:

  • containerSpec (pulumi.Input[dict]) - See ContainerSpec below for details.

    • args (pulumi.Input[list]) - Arguments to the command.

    • commands (pulumi.Input[list]) - The command to be run in the image.

    • configs (pulumi.Input[list]) - See Configs below for details.

      • configId (pulumi.Input[str]) - ConfigID represents the ID of the specific config.

      • configName (pulumi.Input[str]) - The name of the config that this references, but internally it is just provided for lookup/display purposes

      • fileGid (pulumi.Input[str]) - Represents the file GID. Defaults: 0

      • fileMode (pulumi.Input[float]) - Represents the FileMode of the file. Defaults: 0444

      • fileName (pulumi.Input[str]) - Represents the final filename in the filesystem. The specific target file that the config data is written within the docker container, e.g. /root/config/config.json

      • fileUid (pulumi.Input[str]) - Represents the file UID. Defaults: 0

    • dir (pulumi.Input[str]) - The working directory for commands to run in.

    • dnsConfig (pulumi.Input[dict]) - See DNS Config below for details.

      • nameservers (pulumi.Input[list]) - The IP addresses of the name servers, for example, 8.8.8.8

      • options (pulumi.Input[list]) - A list of internal resolver variables to be modified, for example, debug, ndots:3

      • searches (pulumi.Input[list]) - A search list for host-name lookup.

    • env (pulumi.Input[dict]) - A list of environment variables in the form VAR=value.

    • groups (pulumi.Input[list]) - A list of additional groups that the container process will run as.

    • healthcheck (pulumi.Input[dict]) - See Healthcheck below for details.

      • interval (pulumi.Input[str]) - Time between running the check (ms|s|m|h). Default: 0s.

      • retries (pulumi.Input[float]) - Consecutive failures needed to report unhealthy. Default: 0.

      • startPeriod (pulumi.Input[str]) - Start period for the container to initialize before counting retries towards unstable (ms|s|m|h). Default: 0s.

      • tests (pulumi.Input[list]) - Command to run to check health. For example, to run curl -f http://localhost/health set the command to be ["CMD", "curl", "-f", "http://localhost/health"].

      • timeout (pulumi.Input[str]) - Maximum time to allow one check to run (ms|s|m|h). Default: 0s.

    • hostname (pulumi.Input[str]) - The hostname to use for the container, as a valid RFC 1123 hostname.

    • hosts (pulumi.Input[list])

      • host (pulumi.Input[str]) - A list of hostname/IP mappings to add to the container’s hosts file.

      • ip (pulumi.Input[str]) - The ip

    • image (pulumi.Input[str]) - The image used to create the Docker service.

    • isolation (pulumi.Input[str]) - Isolation technology of the containers running the service. (Windows only). Valid values are: default|process|hyperv

    • labels (pulumi.Input[list]) - See Labels below for details.

      • label (pulumi.Input[str]) - Name of the label

      • value (pulumi.Input[str]) - Value of the label

    • mounts (pulumi.Input[list]) - See Mounts below for details.

      • bindOptions (pulumi.Input[dict]) - Optional configuration for the bind type.

        • propagation (pulumi.Input[str]) - A propagation mode with the value.

      • read_only (pulumi.Input[bool]) - Mount the container’s root filesystem as read only.

      • source (pulumi.Input[str]) - The mount source (e.g., a volume name, a host path)

      • target (pulumi.Input[str]) - The container path.

      • tmpfsOptions (pulumi.Input[dict]) - Optional configuration for the tmpf type.

        • mode (pulumi.Input[float]) - See Mode below for details.

        • sizeBytes (pulumi.Input[float]) - The size for the tmpfs mount in bytes.

      • type (pulumi.Input[str]) - SELinux type label

      • volumeOptions (pulumi.Input[dict]) - Optional configuration for the volume type.

        • driverName (pulumi.Input[str])

        • driverOptions (pulumi.Input[dict])

        • labels (pulumi.Input[list]) - See Labels below for details.

          • label (pulumi.Input[str]) - Name of the label

          • value (pulumi.Input[str]) - Value of the label

        • noCopy (pulumi.Input[bool]) - Whether to populate volume with data from the target.

    • privileges (pulumi.Input[dict]) - See Privileges below for details.

      • credentialSpec (pulumi.Input[dict]) - For managed service account (Windows only)

        • file (pulumi.Input[str]) - Load credential spec from this file.

        • registry (pulumi.Input[str]) - Load credential spec from this value in the Windows registry.

      • seLinuxContext (pulumi.Input[dict]) - SELinux labels of the container

        • disable (pulumi.Input[bool]) - Disable SELinux

        • level (pulumi.Input[str]) - SELinux level label

        • role (pulumi.Input[str]) - SELinux role label

        • type (pulumi.Input[str]) - SELinux type label

        • user (pulumi.Input[str]) - The user inside the container.

    • read_only (pulumi.Input[bool]) - Mount the container’s root filesystem as read only.

    • secrets (pulumi.Input[list]) - See Secrets below for details.

      • fileGid (pulumi.Input[str]) - Represents the file GID. Defaults: 0

      • fileMode (pulumi.Input[float]) - Represents the FileMode of the file. Defaults: 0444

      • fileName (pulumi.Input[str]) - Represents the final filename in the filesystem. The specific target file that the secret data is written within the docker container, e.g. /root/secret/secret.json

      • fileUid (pulumi.Input[str]) - Represents the file UID. Defaults: 0

      • secretId (pulumi.Input[str]) - ConfigID represents the ID of the specific secret.

      • secretName (pulumi.Input[str]) - The name of the secret that this references, but internally it is just provided for lookup/display purposes

    • stopGracePeriod (pulumi.Input[str]) - Amount of time to wait for the container to terminate before forcefully removing it (ms|s|m|h).

    • stopSignal (pulumi.Input[str]) - Signal to stop the container.

    • user (pulumi.Input[str]) - The user inside the container.

  • forceUpdate (pulumi.Input[float]) - A counter that triggers an update even if no relevant parameters have been changed. See Docker Spec.

  • log_driver (pulumi.Input[dict]) - See Log Driver below for details.

    • name (pulumi.Input[str]) - The logging driver to use. Either (none|json-file|syslog|journald|gelf|fluentd|awslogs|splunk|etwlogs|gcplogs).

    • options (pulumi.Input[dict]) - The options for the logging driver, e.g.

  • networks (pulumi.Input[list]) - Ids of the networks in which the container will be put in.

  • placement (pulumi.Input[dict]) - See Placement below for details.

    • constraints (pulumi.Input[list]) - An array of constraints. e.g.: node.role==manager

    • platforms (pulumi.Input[list]) - Platforms stores all the platforms that the service’s image can run on

      • architecture (pulumi.Input[str]) - The architecture, e.g., amd64

      • os (pulumi.Input[str]) - The operation system, e.g., linux

    • prefs (pulumi.Input[list]) - Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence, e.g.: spread=node.role.manager

  • resources (pulumi.Input[dict]) - See Resources below for details.

    • limits (pulumi.Input[dict]) - Describes the resources which can be advertised by a node and requested by a task.

      • genericResources (pulumi.Input[dict]) - User-defined resources can be either Integer resources (e.g, SSD=3) or String resources (e.g, GPU=UUID1)

        • discreteResourcesSpecs (pulumi.Input[list]) - The Integer resources, delimited by =

        • namedResourcesSpecs (pulumi.Input[list]) - The String resources, delimited by =

      • memoryBytes (pulumi.Input[float]) - The amount of memory in bytes the container allocates

      • nanoCpus (pulumi.Input[float]) - CPU shares in units of 1/1e9 (or 10^-9) of the CPU. Should be at least 1000000

    • reservation (pulumi.Input[dict]) - An object describing the resources which can be advertised by a node and requested by a task.

      • genericResources (pulumi.Input[dict]) - User-defined resources can be either Integer resources (e.g, SSD=3) or String resources (e.g, GPU=UUID1)

        • discreteResourcesSpecs (pulumi.Input[list]) - The Integer resources, delimited by =

        • namedResourcesSpecs (pulumi.Input[list]) - The String resources, delimited by =

      • memoryBytes (pulumi.Input[float]) - The amount of memory in bytes the container allocates

      • nanoCpus (pulumi.Input[float]) - CPU shares in units of 1/1e9 (or 10^-9) of the CPU. Should be at least 1000000

  • restartPolicy (pulumi.Input[dict]) - See Restart Policy below for details.

    • condition (pulumi.Input[str]) - Condition for restart: (none|on-failure|any)

    • delay (pulumi.Input[str]) - Delay between restart attempts (ms|s|m|h)

    • maxAttempts (pulumi.Input[float]) - Maximum attempts to restart a given container before giving up (default value is 0, which is ignored)

    • window (pulumi.Input[str]) - The time window used to evaluate the restart policy (default value is 0, which is unbounded) (ms|s|m|h)

  • runtime (pulumi.Input[str]) - Runtime is the type of runtime specified for the task executor. See Docker Runtime.

The update_config object supports the following:

  • delay (pulumi.Input[str]) - Delay between updates (ns|us|ms|s|m|h), e.g. 5s.

  • failureAction (pulumi.Input[str]) - Action on update failure: pause|continue|rollback.

  • maxFailureRatio (pulumi.Input[str]) - The failure rate to tolerate during an update as float. Important: the floatneed to be wrapped in a string to avoid internal casting and precision errors.

  • monitor (pulumi.Input[str]) - Duration after each task update to monitor for failure (ns|us|ms|s|m|h)

  • order (pulumi.Input[str]) - Update order either ‘stop-first’ or ‘start-first’.

  • parallelism (pulumi.Input[float]) - The maximum number of tasks to be updated in one iteration simultaneously (0 to update all at once).

auth: pulumi.Output[dict] = None

See Auth below for details.

  • password (str) - The password to use for authenticating to the registry. If this is blank, the DOCKER_REGISTRY_PASS is also be checked.

  • server_address (str) - The address of the registry server

  • username (str) - The username to use for authenticating to the registry. If this is blank, the DOCKER_REGISTRY_USER is also be checked.

converge_config: pulumi.Output[dict] = None

See Converge Config below for details.

  • delay (str) - Time between each the check to check docker endpoint (ms|s|m|h). For example, to check if all tasks are up when a service is created, or to check if all tasks are successfully updated on an update. Default: 7s.

  • timeout (str) - The timeout of the service to reach the desired state (s|m). Default: 3m.

endpoint_spec: pulumi.Output[dict] = None

See EndpointSpec below for details.

  • mode (str) - The mode of resolution to use for internal load balancing between tasks. (vip|dnsrr). Default: vip.

  • ports (list) - See Ports below for details.

    • name (str) - The name of the Docker service.

    • protocol (str) - Protocol that can be used over this port: tcp|udp|sctp. Default: tcp.

    • publishMode (str) - Represents the mode in which the port is to be published: ingress|host

    • publishedPort (float) - The port on the swarm hosts. If not set the value of target_port will be used.

    • targetPort (float) - Port inside the container.

labels: pulumi.Output[list] = None

See Labels below for details.

  • label (str) - Name of the label

  • value (str) - Value of the label

mode: pulumi.Output[dict] = None

See Mode below for details.

  • global (bool) - set it to true to run the service in the global mode

  • replicated (dict) - , which contains atm only the amount of replicas

    • replicas (float)

name: pulumi.Output[str] = None

The name of the Docker service.

rollback_config: pulumi.Output[dict] = None

See RollbackConfig below for details.

  • delay (str) - Delay between restart attempts (ms|s|m|h) all tasks are up when a service is created, or to check if all tasks are successfully updated on an update. Default: 7s.

  • failureAction (str) - Action on update failure: pause|continue|rollback.

  • maxFailureRatio (str) - The failure rate to tolerate during an update as float. Important: the floatneed to be wrapped in a string to avoid internal casting and precision errors.

  • monitor (str) - Duration after each task update to monitor for failure (ns|us|ms|s|m|h)

  • order (str) - Update order either ‘stop-first’ or ‘start-first’.

  • parallelism (float) - The maximum number of tasks to be updated in one iteration simultaneously (0 to update all at once).

task_spec: pulumi.Output[dict] = None

See TaskSpec below for details.

  • containerSpec (dict) - See ContainerSpec below for details.

    • args (list) - Arguments to the command.

    • commands (list) - The command to be run in the image.

    • configs (list) - See Configs below for details.

      • configId (str) - ConfigID represents the ID of the specific config.

      • configName (str) - The name of the config that this references, but internally it is just provided for lookup/display purposes

      • fileGid (str) - Represents the file GID. Defaults: 0

      • fileMode (float) - Represents the FileMode of the file. Defaults: 0444

      • fileName (str) - Represents the final filename in the filesystem. The specific target file that the config data is written within the docker container, e.g. /root/config/config.json

      • fileUid (str) - Represents the file UID. Defaults: 0

    • dir (str) - The working directory for commands to run in.

    • dnsConfig (dict) - See DNS Config below for details.

      • nameservers (list) - The IP addresses of the name servers, for example, 8.8.8.8

      • options (list) - A list of internal resolver variables to be modified, for example, debug, ndots:3

      • searches (list) - A search list for host-name lookup.

    • env (dict) - A list of environment variables in the form VAR=value.

    • groups (list) - A list of additional groups that the container process will run as.

    • healthcheck (dict) - See Healthcheck below for details.

      • interval (str) - Time between running the check (ms|s|m|h). Default: 0s.

      • retries (float) - Consecutive failures needed to report unhealthy. Default: 0.

      • startPeriod (str) - Start period for the container to initialize before counting retries towards unstable (ms|s|m|h). Default: 0s.

      • tests (list) - Command to run to check health. For example, to run curl -f http://localhost/health set the command to be ["CMD", "curl", "-f", "http://localhost/health"].

      • timeout (str) - Maximum time to allow one check to run (ms|s|m|h). Default: 0s.

    • hostname (str) - The hostname to use for the container, as a valid RFC 1123 hostname.

    • hosts (list)

      • host (str) - A list of hostname/IP mappings to add to the container’s hosts file.

      • ip (str) - The ip

    • image (str) - The image used to create the Docker service.

    • isolation (str) - Isolation technology of the containers running the service. (Windows only). Valid values are: default|process|hyperv

    • labels (list) - See Labels below for details.

      • label (str) - Name of the label

      • value (str) - Value of the label

    • mounts (list) - See Mounts below for details.

      • bindOptions (dict) - Optional configuration for the bind type.

        • propagation (str) - A propagation mode with the value.

      • read_only (bool) - Mount the container’s root filesystem as read only.

      • source (str) - The mount source (e.g., a volume name, a host path)

      • target (str) - The container path.

      • tmpfsOptions (dict) - Optional configuration for the tmpf type.

        • mode (float) - See Mode below for details.

        • sizeBytes (float) - The size for the tmpfs mount in bytes.

      • type (str) - SELinux type label

      • volumeOptions (dict) - Optional configuration for the volume type.

        • driverName (str)

        • driverOptions (dict)

        • labels (list) - See Labels below for details.

          • label (str) - Name of the label

          • value (str) - Value of the label

        • noCopy (bool) - Whether to populate volume with data from the target.

    • privileges (dict) - See Privileges below for details.

      • credentialSpec (dict) - For managed service account (Windows only)

        • file (str) - Load credential spec from this file.

        • registry (str) - Load credential spec from this value in the Windows registry.

      • seLinuxContext (dict) - SELinux labels of the container

        • disable (bool) - Disable SELinux

        • level (str) - SELinux level label

        • role (str) - SELinux role label

        • type (str) - SELinux type label

        • user (str) - The user inside the container.

    • read_only (bool) - Mount the container’s root filesystem as read only.

    • secrets (list) - See Secrets below for details.

      • fileGid (str) - Represents the file GID. Defaults: 0

      • fileMode (float) - Represents the FileMode of the file. Defaults: 0444

      • fileName (str) - Represents the final filename in the filesystem. The specific target file that the secret data is written within the docker container, e.g. /root/secret/secret.json

      • fileUid (str) - Represents the file UID. Defaults: 0

      • secretId (str) - ConfigID represents the ID of the specific secret.

      • secretName (str) - The name of the secret that this references, but internally it is just provided for lookup/display purposes

    • stopGracePeriod (str) - Amount of time to wait for the container to terminate before forcefully removing it (ms|s|m|h).

    • stopSignal (str) - Signal to stop the container.

    • user (str) - The user inside the container.

  • forceUpdate (float) - A counter that triggers an update even if no relevant parameters have been changed. See Docker Spec.

  • log_driver (dict) - See Log Driver below for details.

    • name (str) - The logging driver to use. Either (none|json-file|syslog|journald|gelf|fluentd|awslogs|splunk|etwlogs|gcplogs).

    • options (dict) - The options for the logging driver, e.g.

  • networks (list) - Ids of the networks in which the container will be put in.

  • placement (dict) - See Placement below for details.

    • constraints (list) - An array of constraints. e.g.: node.role==manager

    • platforms (list) - Platforms stores all the platforms that the service’s image can run on

      • architecture (str) - The architecture, e.g., amd64

      • os (str) - The operation system, e.g., linux

    • prefs (list) - Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence, e.g.: spread=node.role.manager

  • resources (dict) - See Resources below for details.

    • limits (dict) - Describes the resources which can be advertised by a node and requested by a task.

      • genericResources (dict) - User-defined resources can be either Integer resources (e.g, SSD=3) or String resources (e.g, GPU=UUID1)

        • discreteResourcesSpecs (list) - The Integer resources, delimited by =

        • namedResourcesSpecs (list) - The String resources, delimited by =

      • memoryBytes (float) - The amount of memory in bytes the container allocates

      • nanoCpus (float) - CPU shares in units of 1/1e9 (or 10^-9) of the CPU. Should be at least 1000000

    • reservation (dict) - An object describing the resources which can be advertised by a node and requested by a task.

      • genericResources (dict) - User-defined resources can be either Integer resources (e.g, SSD=3) or String resources (e.g, GPU=UUID1)

        • discreteResourcesSpecs (list) - The Integer resources, delimited by =

        • namedResourcesSpecs (list) - The String resources, delimited by =

      • memoryBytes (float) - The amount of memory in bytes the container allocates

      • nanoCpus (float) - CPU shares in units of 1/1e9 (or 10^-9) of the CPU. Should be at least 1000000

  • restartPolicy (dict) - See Restart Policy below for details.

    • condition (str) - Condition for restart: (none|on-failure|any)

    • delay (str) - Delay between restart attempts (ms|s|m|h)

    • maxAttempts (float) - Maximum attempts to restart a given container before giving up (default value is 0, which is ignored)

    • window (str) - The time window used to evaluate the restart policy (default value is 0, which is unbounded) (ms|s|m|h)

  • runtime (str) - Runtime is the type of runtime specified for the task executor. See Docker Runtime.

update_config: pulumi.Output[dict] = None

See UpdateConfig below for details.

  • delay (str) - Delay between updates (ns|us|ms|s|m|h), e.g. 5s.

  • failureAction (str) - Action on update failure: pause|continue|rollback.

  • maxFailureRatio (str) - The failure rate to tolerate during an update as float. Important: the floatneed to be wrapped in a string to avoid internal casting and precision errors.

  • monitor (str) - Duration after each task update to monitor for failure (ns|us|ms|s|m|h)

  • order (str) - Update order either ‘stop-first’ or ‘start-first’.

  • parallelism (float) - The maximum number of tasks to be updated in one iteration simultaneously (0 to update all at once).

static get(resource_name, id, opts=None, auth=None, converge_config=None, endpoint_spec=None, labels=None, mode=None, name=None, rollback_config=None, task_spec=None, update_config=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • auth (pulumi.Input[dict]) – See Auth below for details.

  • converge_config (pulumi.Input[dict]) – See Converge Config below for details.

  • endpoint_spec (pulumi.Input[dict]) – See EndpointSpec below for details.

  • labels (pulumi.Input[list]) – See Labels below for details.

  • mode (pulumi.Input[dict]) – See Mode below for details.

  • name (pulumi.Input[str]) – The name of the Docker service.

  • rollback_config (pulumi.Input[dict]) – See RollbackConfig below for details.

  • task_spec (pulumi.Input[dict]) – See TaskSpec below for details.

  • update_config (pulumi.Input[dict]) – See UpdateConfig below for details.

The auth object supports the following:

  • password (pulumi.Input[str]) - The password to use for authenticating to the registry. If this is blank, the DOCKER_REGISTRY_PASS is also be checked.

  • server_address (pulumi.Input[str]) - The address of the registry server

  • username (pulumi.Input[str]) - The username to use for authenticating to the registry. If this is blank, the DOCKER_REGISTRY_USER is also be checked.

The converge_config object supports the following:

  • delay (pulumi.Input[str]) - Time between each the check to check docker endpoint (ms|s|m|h). For example, to check if all tasks are up when a service is created, or to check if all tasks are successfully updated on an update. Default: 7s.

  • timeout (pulumi.Input[str]) - The timeout of the service to reach the desired state (s|m). Default: 3m.

The endpoint_spec object supports the following:

  • mode (pulumi.Input[str]) - The mode of resolution to use for internal load balancing between tasks. (vip|dnsrr). Default: vip.

  • ports (pulumi.Input[list]) - See Ports below for details.

    • name (pulumi.Input[str]) - The name of the Docker service.

    • protocol (pulumi.Input[str]) - Protocol that can be used over this port: tcp|udp|sctp. Default: tcp.

    • publishMode (pulumi.Input[str]) - Represents the mode in which the port is to be published: ingress|host

    • publishedPort (pulumi.Input[float]) - The port on the swarm hosts. If not set the value of target_port will be used.

    • targetPort (pulumi.Input[float]) - Port inside the container.

The labels object supports the following:

  • label (pulumi.Input[str]) - Name of the label

  • value (pulumi.Input[str]) - Value of the label

The mode object supports the following:

  • global (pulumi.Input[bool]) - set it to true to run the service in the global mode

  • replicated (pulumi.Input[dict]) - , which contains atm only the amount of replicas

    • replicas (pulumi.Input[float])

The rollback_config object supports the following:

  • delay (pulumi.Input[str]) - Delay between restart attempts (ms|s|m|h) all tasks are up when a service is created, or to check if all tasks are successfully updated on an update. Default: 7s.

  • failureAction (pulumi.Input[str]) - Action on update failure: pause|continue|rollback.

  • maxFailureRatio (pulumi.Input[str]) - The failure rate to tolerate during an update as float. Important: the floatneed to be wrapped in a string to avoid internal casting and precision errors.

  • monitor (pulumi.Input[str]) - Duration after each task update to monitor for failure (ns|us|ms|s|m|h)

  • order (pulumi.Input[str]) - Update order either ‘stop-first’ or ‘start-first’.

  • parallelism (pulumi.Input[float]) - The maximum number of tasks to be updated in one iteration simultaneously (0 to update all at once).

The task_spec object supports the following:

  • containerSpec (pulumi.Input[dict]) - See ContainerSpec below for details.

    • args (pulumi.Input[list]) - Arguments to the command.

    • commands (pulumi.Input[list]) - The command to be run in the image.

    • configs (pulumi.Input[list]) - See Configs below for details.

      • configId (pulumi.Input[str]) - ConfigID represents the ID of the specific config.

      • configName (pulumi.Input[str]) - The name of the config that this references, but internally it is just provided for lookup/display purposes

      • fileGid (pulumi.Input[str]) - Represents the file GID. Defaults: 0

      • fileMode (pulumi.Input[float]) - Represents the FileMode of the file. Defaults: 0444

      • fileName (pulumi.Input[str]) - Represents the final filename in the filesystem. The specific target file that the config data is written within the docker container, e.g. /root/config/config.json

      • fileUid (pulumi.Input[str]) - Represents the file UID. Defaults: 0

    • dir (pulumi.Input[str]) - The working directory for commands to run in.

    • dnsConfig (pulumi.Input[dict]) - See DNS Config below for details.

      • nameservers (pulumi.Input[list]) - The IP addresses of the name servers, for example, 8.8.8.8

      • options (pulumi.Input[list]) - A list of internal resolver variables to be modified, for example, debug, ndots:3

      • searches (pulumi.Input[list]) - A search list for host-name lookup.

    • env (pulumi.Input[dict]) - A list of environment variables in the form VAR=value.

    • groups (pulumi.Input[list]) - A list of additional groups that the container process will run as.

    • healthcheck (pulumi.Input[dict]) - See Healthcheck below for details.

      • interval (pulumi.Input[str]) - Time between running the check (ms|s|m|h). Default: 0s.

      • retries (pulumi.Input[float]) - Consecutive failures needed to report unhealthy. Default: 0.

      • startPeriod (pulumi.Input[str]) - Start period for the container to initialize before counting retries towards unstable (ms|s|m|h). Default: 0s.

      • tests (pulumi.Input[list]) - Command to run to check health. For example, to run curl -f http://localhost/health set the command to be ["CMD", "curl", "-f", "http://localhost/health"].

      • timeout (pulumi.Input[str]) - Maximum time to allow one check to run (ms|s|m|h). Default: 0s.

    • hostname (pulumi.Input[str]) - The hostname to use for the container, as a valid RFC 1123 hostname.

    • hosts (pulumi.Input[list])

      • host (pulumi.Input[str]) - A list of hostname/IP mappings to add to the container’s hosts file.

      • ip (pulumi.Input[str]) - The ip

    • image (pulumi.Input[str]) - The image used to create the Docker service.

    • isolation (pulumi.Input[str]) - Isolation technology of the containers running the service. (Windows only). Valid values are: default|process|hyperv

    • labels (pulumi.Input[list]) - See Labels below for details.

      • label (pulumi.Input[str]) - Name of the label

      • value (pulumi.Input[str]) - Value of the label

    • mounts (pulumi.Input[list]) - See Mounts below for details.

      • bindOptions (pulumi.Input[dict]) - Optional configuration for the bind type.

        • propagation (pulumi.Input[str]) - A propagation mode with the value.

      • read_only (pulumi.Input[bool]) - Mount the container’s root filesystem as read only.

      • source (pulumi.Input[str]) - The mount source (e.g., a volume name, a host path)

      • target (pulumi.Input[str]) - The container path.

      • tmpfsOptions (pulumi.Input[dict]) - Optional configuration for the tmpf type.

        • mode (pulumi.Input[float]) - See Mode below for details.

        • sizeBytes (pulumi.Input[float]) - The size for the tmpfs mount in bytes.

      • type (pulumi.Input[str]) - SELinux type label

      • volumeOptions (pulumi.Input[dict]) - Optional configuration for the volume type.

        • driverName (pulumi.Input[str])

        • driverOptions (pulumi.Input[dict])

        • labels (pulumi.Input[list]) - See Labels below for details.

          • label (pulumi.Input[str]) - Name of the label

          • value (pulumi.Input[str]) - Value of the label

        • noCopy (pulumi.Input[bool]) - Whether to populate volume with data from the target.

    • privileges (pulumi.Input[dict]) - See Privileges below for details.

      • credentialSpec (pulumi.Input[dict]) - For managed service account (Windows only)

        • file (pulumi.Input[str]) - Load credential spec from this file.

        • registry (pulumi.Input[str]) - Load credential spec from this value in the Windows registry.

      • seLinuxContext (pulumi.Input[dict]) - SELinux labels of the container

        • disable (pulumi.Input[bool]) - Disable SELinux

        • level (pulumi.Input[str]) - SELinux level label

        • role (pulumi.Input[str]) - SELinux role label

        • type (pulumi.Input[str]) - SELinux type label

        • user (pulumi.Input[str]) - The user inside the container.

    • read_only (pulumi.Input[bool]) - Mount the container’s root filesystem as read only.

    • secrets (pulumi.Input[list]) - See Secrets below for details.

      • fileGid (pulumi.Input[str]) - Represents the file GID. Defaults: 0

      • fileMode (pulumi.Input[float]) - Represents the FileMode of the file. Defaults: 0444

      • fileName (pulumi.Input[str]) - Represents the final filename in the filesystem. The specific target file that the secret data is written within the docker container, e.g. /root/secret/secret.json

      • fileUid (pulumi.Input[str]) - Represents the file UID. Defaults: 0

      • secretId (pulumi.Input[str]) - ConfigID represents the ID of the specific secret.

      • secretName (pulumi.Input[str]) - The name of the secret that this references, but internally it is just provided for lookup/display purposes

    • stopGracePeriod (pulumi.Input[str]) - Amount of time to wait for the container to terminate before forcefully removing it (ms|s|m|h).

    • stopSignal (pulumi.Input[str]) - Signal to stop the container.

    • user (pulumi.Input[str]) - The user inside the container.

  • forceUpdate (pulumi.Input[float]) - A counter that triggers an update even if no relevant parameters have been changed. See Docker Spec.

  • log_driver (pulumi.Input[dict]) - See Log Driver below for details.

    • name (pulumi.Input[str]) - The logging driver to use. Either (none|json-file|syslog|journald|gelf|fluentd|awslogs|splunk|etwlogs|gcplogs).

    • options (pulumi.Input[dict]) - The options for the logging driver, e.g.

  • networks (pulumi.Input[list]) - Ids of the networks in which the container will be put in.

  • placement (pulumi.Input[dict]) - See Placement below for details.

    • constraints (pulumi.Input[list]) - An array of constraints. e.g.: node.role==manager

    • platforms (pulumi.Input[list]) - Platforms stores all the platforms that the service’s image can run on

      • architecture (pulumi.Input[str]) - The architecture, e.g., amd64

      • os (pulumi.Input[str]) - The operation system, e.g., linux

    • prefs (pulumi.Input[list]) - Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence, e.g.: spread=node.role.manager

  • resources (pulumi.Input[dict]) - See Resources below for details.

    • limits (pulumi.Input[dict]) - Describes the resources which can be advertised by a node and requested by a task.

      • genericResources (pulumi.Input[dict]) - User-defined resources can be either Integer resources (e.g, SSD=3) or String resources (e.g, GPU=UUID1)

        • discreteResourcesSpecs (pulumi.Input[list]) - The Integer resources, delimited by =

        • namedResourcesSpecs (pulumi.Input[list]) - The String resources, delimited by =

      • memoryBytes (pulumi.Input[float]) - The amount of memory in bytes the container allocates

      • nanoCpus (pulumi.Input[float]) - CPU shares in units of 1/1e9 (or 10^-9) of the CPU. Should be at least 1000000

    • reservation (pulumi.Input[dict]) - An object describing the resources which can be advertised by a node and requested by a task.

      • genericResources (pulumi.Input[dict]) - User-defined resources can be either Integer resources (e.g, SSD=3) or String resources (e.g, GPU=UUID1)

        • discreteResourcesSpecs (pulumi.Input[list]) - The Integer resources, delimited by =

        • namedResourcesSpecs (pulumi.Input[list]) - The String resources, delimited by =

      • memoryBytes (pulumi.Input[float]) - The amount of memory in bytes the container allocates

      • nanoCpus (pulumi.Input[float]) - CPU shares in units of 1/1e9 (or 10^-9) of the CPU. Should be at least 1000000

  • restartPolicy (pulumi.Input[dict]) - See Restart Policy below for details.

    • condition (pulumi.Input[str]) - Condition for restart: (none|on-failure|any)

    • delay (pulumi.Input[str]) - Delay between restart attempts (ms|s|m|h)

    • maxAttempts (pulumi.Input[float]) - Maximum attempts to restart a given container before giving up (default value is 0, which is ignored)

    • window (pulumi.Input[str]) - The time window used to evaluate the restart policy (default value is 0, which is unbounded) (ms|s|m|h)

  • runtime (pulumi.Input[str]) - Runtime is the type of runtime specified for the task executor. See Docker Runtime.

The update_config object supports the following:

  • delay (pulumi.Input[str]) - Delay between updates (ns|us|ms|s|m|h), e.g. 5s.

  • failureAction (pulumi.Input[str]) - Action on update failure: pause|continue|rollback.

  • maxFailureRatio (pulumi.Input[str]) - The failure rate to tolerate during an update as float. Important: the floatneed to be wrapped in a string to avoid internal casting and precision errors.

  • monitor (pulumi.Input[str]) - Duration after each task update to monitor for failure (ns|us|ms|s|m|h)

  • order (pulumi.Input[str]) - Update order either ‘stop-first’ or ‘start-first’.

  • parallelism (pulumi.Input[float]) - The maximum number of tasks to be updated in one iteration simultaneously (0 to update all at once).

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_docker.ServiceConfig(resource_name, opts=None, data=None, name=None, __props__=None, __name__=None, __opts__=None)

Manages the configuration of a Docker service in a swarm.

import pulumi
import pulumi_docker as docker

# Creates a config
foo_config = docker.ServiceConfig("fooConfig", data="ewogICJzZXJIfQo=")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • data (pulumi.Input[str]) – The base64 encoded data of the config.

  • name (pulumi.Input[str]) – The name of the Docker config.

data: pulumi.Output[str] = None

The base64 encoded data of the config.

name: pulumi.Output[str] = None

The name of the Docker config.

static get(resource_name, id, opts=None, data=None, name=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • data (pulumi.Input[str]) – The base64 encoded data of the config.

  • name (pulumi.Input[str]) – The name of the Docker config.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_docker.Volume(resource_name, opts=None, driver=None, driver_opts=None, labels=None, name=None, __props__=None, __name__=None, __opts__=None)

Creates and destroys a volume in Docker. This can be used alongside docker_container to prepare volumes that can be shared across containers.

import pulumi
import pulumi_docker as docker

# Creates a docker volume "shared_volume".
shared_volume = docker.Volume("sharedVolume")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • driver (pulumi.Input[str]) – Driver type for the volume (defaults to local).

  • driver_opts (pulumi.Input[dict]) – Options specific to the driver.

  • labels (pulumi.Input[list]) – User-defined key/value metadata.

  • name (pulumi.Input[str]) – The name of the Docker volume (generated if not provided).

The labels object supports the following:

  • label (pulumi.Input[str])

  • value (pulumi.Input[str])

driver: pulumi.Output[str] = None

Driver type for the volume (defaults to local).

driver_opts: pulumi.Output[dict] = None

Options specific to the driver.

labels: pulumi.Output[list] = None

User-defined key/value metadata.

  • label (str)

  • value (str)

name: pulumi.Output[str] = None

The name of the Docker volume (generated if not provided).

static get(resource_name, id, opts=None, driver=None, driver_opts=None, labels=None, mountpoint=None, name=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • driver (pulumi.Input[str]) – Driver type for the volume (defaults to local).

  • driver_opts (pulumi.Input[dict]) – Options specific to the driver.

  • labels (pulumi.Input[list]) – User-defined key/value metadata.

  • name (pulumi.Input[str]) – The name of the Docker volume (generated if not provided).

The labels object supports the following:

  • label (pulumi.Input[str])

  • value (pulumi.Input[str])

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

pulumi_docker.build_and_push_image(base_image_name: str, path_or_build: Union[str, pulumi_docker.docker.DockerBuild, Awaitable[Union[str, pulumi_docker.docker.DockerBuild]], Output[T]], repository_url: Union[str, Awaitable[str], Output[T]], log_resource: pulumi.resource.Resource, registry: Optional[pulumi_docker.docker.Registry], skip_push: bool = False) → str

build_and_push_image will build and push the Dockerfile and context from [pathOrBuild] into the requested docker repo [repository_url]. It returns the unique target image name for the image in the docker repository. During preview this will build the image, and return the target image name, without pushing. During a normal update, it will do the same, as well as tag and push the image.

pulumi_docker.get_network(id=None, name=None, opts=None)

Finds a specific docker network and returns information about it.

import pulumi
import pulumi_docker as docker

main = docker.get_network(name="main")
Parameters
  • id (str) – The id of the Docker network.

  • name (str) – The name of the Docker network.

pulumi_docker.get_registry_image(name=None, opts=None)

Reads the image metadata from a Docker Registry. Used in conjunction with the docker_image resource to keep an image up to date on the latest available version of the tag.

import pulumi
import pulumi_docker as docker

ubuntu_registry_image = docker.get_registry_image(name="ubuntu:precise")
ubuntu_remote_image = docker.RemoteImage("ubuntuRemoteImage",
    name=ubuntu_registry_image.name,
    pull_triggers=[ubuntu_registry_image.sha256_digest])
Parameters

name (str) – The name of the Docker image, including any tags. e.g. alpine:latest

pulumi_docker.random() → x in the interval [0, 1).
pulumi_docker.run_command_that_can_fail(cmd_name: str, args: List[str], log_resource: pulumi.resource.Resource, report_full_command_line: bool, report_error_as_warning: bool, stdin: Optional[str] = None, env: Optional[Mapping[str, str]] = None) → pulumi_docker.docker.CommandResult

Runs a CLI command in a child process, returning a future for the process’s exit. Both stdout and stderr are redirected to process.stdout and process.stderr by default.

If the [stdin] argument is defined, its contents are piped into stdin for the child process.

[log_resource] is used to specify the resource to associate command output with. Stderr messages are always sent (since they may contain important information about something that’s gone wrong). Stdout messages will be logged ephemerally to this resource. This lets the user know there is progress, without having that dumped on them at the end. If an error occurs though, the stdout content will be printed.