Interface TaskSpecContainerSpec

Container spec for the service.


> Note: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are > mutually exclusive. PluginSpec is only used when the Runtime field > is set to plugin. NetworkAttachmentSpec is used when the Runtime > field is set to attachment. TaskSpecContainerSpec

interface TaskSpecContainerSpec {
    Args?: string[];
    CapabilityAdd?: string[];
    CapabilityDrop?: string[];
    Command?: string[];
    Configs?: TaskSpecContainerSpecConfigsInner[];
    DNSConfig?: TaskSpecContainerSpecDNSConfig;
    Dir?: string;
    Env?: string[];
    Groups?: string[];
    HealthCheck?: HealthConfig;
    Hostname?: string;
    Hosts?: string[];
    Image?: string;
    Init?: null | boolean;
    Isolation?: TaskSpecContainerSpecIsolationEnum;
    Labels?: {
        [key: string]: string;
    };
    Mounts?: Mount[];
    OpenStdin?: boolean;
    Privileges?: TaskSpecContainerSpecPrivileges;
    ReadOnly?: boolean;
    Secrets?: TaskSpecContainerSpecSecretsInner[];
    StopGracePeriod?: number;
    StopSignal?: string;
    Sysctls?: {
        [key: string]: string;
    };
    TTY?: boolean;
    Ulimits?: ResourcesUlimitsInner[];
    User?: string;
}

Properties

Args?: string[]

Arguments to the command.

CapabilityAdd?: string[]

A list of kernel capabilities to add to the default set for the container.

CapabilityDrop?: string[]

A list of kernel capabilities to drop from the default set for the container.

Command?: string[]

The command to be run in the image.

Configs contains references to zero or more configs that will be exposed to the service.

Dir?: string

The working directory for commands to run in.

Env?: string[]

A list of environment variables in the form VAR=value.

Groups?: string[]

A list of additional groups that the container process will run as.

HealthCheck?: HealthConfig
Hostname?: string

The hostname to use for the container, as a valid RFC 1123 hostname.

Hosts?: string[]

A list of hostname/IP mappings to add to the container's hosts file. The format of extra hosts is specified in the hosts(5) man page: IP_address canonical_hostname [aliases...]

Image?: string

The image name to use for the container

Init?: null | boolean

Run an init inside the container that forwards signals and reaps processes. This field is omitted if empty, and the default (as configured on the daemon) is used.

Isolation technology of the containers running the service. (Windows only)

Labels?: {
    [key: string]: string;
}

User-defined key/value data.

Mounts?: Mount[]

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

OpenStdin?: boolean

Open stdin

ReadOnly?: boolean

Mount the container's root filesystem as read only.

Secrets contains references to zero or more secrets that will be exposed to the service.

StopGracePeriod?: number

Amount of time to wait for the container to terminate before forcefully killing it.

StopSignal?: string

Signal to stop the container.

Sysctls?: {
    [key: string]: string;
}

Set kernel namedspaced parameters (sysctls) in the container. The Sysctls option on services accepts the same sysctls as the are supported on containers. Note that while the same sysctls are supported, no guarantees or checks are made about their suitability for a clustered environment, and it's up to the user to determine whether a given sysctl will work properly in a Service.

TTY?: boolean

Whether a pseudo-TTY should be allocated.

A list of resource limits to set in the container. For example: {\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}"

User?: string

The user inside the container.