Skip to content

dsdk / v1.47 / TaskSpec

Type Alias: TaskSpec ​

TaskSpec: object

User modifiable task configuration.

Type declaration ​

NameTypeDescription
ContainerSpec?objectContainer 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.
ContainerSpec.Args?string[]Arguments to the command.
ContainerSpec.CapabilityAdd?string[]A list of kernel capabilities to add to the default set for the container.
ContainerSpec.CapabilityDrop?string[]A list of kernel capabilities to drop from the default set for the container.
ContainerSpec.Command?string[]The command to be run in the image.
ContainerSpec.Configs?object[]Configs contains references to zero or more configs that will be exposed to the service.
ContainerSpec.Dir?stringThe working directory for commands to run in.
ContainerSpec.DNSConfig?objectSpecification for DNS related configurations in resolver configuration file (resolv.conf).
ContainerSpec.DNSConfig.Nameservers?string[]The IP addresses of the name servers.
ContainerSpec.DNSConfig.Options?string[]A list of internal resolver variables to be modified (e.g., debug, ndots:3, etc.).
ContainerSpec.DNSConfig.Search?string[]A search list for host-name lookup.
ContainerSpec.Env?string[]A list of environment variables in the form VAR=value.
ContainerSpec.Groups?string[]A list of additional groups that the container process will run as.
ContainerSpec.HealthCheck?HealthConfig-
ContainerSpec.Hostname?stringThe hostname to use for the container, as a valid RFC 1123 hostname.
ContainerSpec.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...]
ContainerSpec.Image?stringThe image name to use for the container
ContainerSpec.Init?boolean | nullRun 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.
ContainerSpec.Isolation?"default" | "process" | "hyperv"Isolation technology of the containers running the service. (Windows only)
ContainerSpec.Labels?objectUser-defined key/value data.
ContainerSpec.Mounts?Mount[]Specification for mounts to be added to containers created as part of the service.
ContainerSpec.OomScoreAdj?numberAn integer value containing the score given to the container in order to tune OOM killer preferences.
ContainerSpec.OpenStdin?booleanOpen stdin
ContainerSpec.Privileges?objectSecurity options for the container
ContainerSpec.Privileges.AppArmor?objectOptions for configuring AppArmor on the container
ContainerSpec.Privileges.AppArmor.Mode?"default" | "disabled"-
ContainerSpec.Privileges.CredentialSpec?objectCredentialSpec for managed service account (Windows only)
ContainerSpec.Privileges.CredentialSpec.Config?stringLoad credential spec from a Swarm Config with the given ID. The specified config must also be present in the Configs field with the Runtime property set.


> Note: CredentialSpec.File, CredentialSpec.Registry, > and CredentialSpec.Config are mutually exclusive.
ContainerSpec.Privileges.CredentialSpec.File?stringLoad credential spec from this file. The file is read by the daemon, and must be present in the CredentialSpecs subdirectory in the docker data directory, which defaults to C:\ProgramData\Docker\ on Windows. For example, specifying spec.json loads C:\ProgramData\Docker\CredentialSpecs\spec.json.


> Note: CredentialSpec.File, CredentialSpec.Registry, > and CredentialSpec.Config are mutually exclusive.
ContainerSpec.Privileges.CredentialSpec.Registry?stringLoad credential spec from this value in the Windows registry. The specified registry value must be located in: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs


> Note: CredentialSpec.File, CredentialSpec.Registry, > and CredentialSpec.Config are mutually exclusive.
ContainerSpec.Privileges.NoNewPrivileges?booleanConfiguration of the no_new_privs bit in the container
ContainerSpec.Privileges.Seccomp?objectOptions for configuring seccomp on the container
ContainerSpec.Privileges.Seccomp.Mode?"default" | "unconfined" | "custom"-
ContainerSpec.Privileges.Seccomp.Profile?stringThe custom seccomp profile as a json object
ContainerSpec.Privileges.SELinuxContext?objectSELinux labels of the container
ContainerSpec.Privileges.SELinuxContext.Disable?booleanDisable SELinux
ContainerSpec.Privileges.SELinuxContext.Level?stringSELinux level label
ContainerSpec.Privileges.SELinuxContext.Role?stringSELinux role label
ContainerSpec.Privileges.SELinuxContext.Type?stringSELinux type label
ContainerSpec.Privileges.SELinuxContext.User?stringSELinux user label
ContainerSpec.ReadOnly?booleanMount the container's root filesystem as read only.
ContainerSpec.Secrets?object[]Secrets contains references to zero or more secrets that will be exposed to the service.
ContainerSpec.StopGracePeriod?numberAmount of time to wait for the container to terminate before forcefully killing it.
ContainerSpec.StopSignal?stringSignal to stop the container.
ContainerSpec.Sysctls?objectSet 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.
ContainerSpec.TTY?booleanWhether a pseudo-TTY should be allocated.
ContainerSpec.Ulimits?object[]A list of resource limits to set in the container. For example: {"Name": "nofile", "Soft": 1024, "Hard": 2048}"
ContainerSpec.User?stringThe user inside the container.
ForceUpdate?numberA counter that triggers an update even if no relevant parameters have been changed.
LogDriver?objectSpecifies the log driver to use for tasks created from this spec. If not present, the default one for the swarm will be used, finally falling back to the engine default if not specified.
LogDriver.Name?string-
LogDriver.Options?object-
NetworkAttachmentSpec?objectRead-only spec type for non-swarm containers attached to swarm overlay networks.


> 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.
NetworkAttachmentSpec.ContainerID?stringID of the container represented by this task
Networks?NetworkAttachmentConfig[]Specifies which networks the service should attach to.
Placement?object-
Placement.Constraints?string[]An array of constraint expressions to limit the set of nodes where a task can be scheduled. Constraint expressions can either use a match (==) or exclude (!=) rule. Multiple constraints find nodes that satisfy every expression (AND match). Constraints can match node or Docker Engine labels as follows: node attribute
Placement.MaxReplicas?numberMaximum number of replicas for per node (default value is 0, which is unlimited)
Placement.Platforms?Platform[]Platforms stores all the platforms that the service's image can run on. This field is used in the platform filter for scheduling. If empty, then the platform filter is off, meaning there are no scheduling restrictions.
Placement.Preferences?object[]Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence.
PluginSpec?objectPlugin spec for the service. (Experimental release only.)


> 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.
PluginSpec.Disabled?booleanDisable the plugin once scheduled.
PluginSpec.Name?stringThe name or 'alias' to use for the plugin.
PluginSpec.PluginPrivilege?PluginPrivilege[]-
PluginSpec.Remote?stringThe plugin image reference to use.
Resources?objectResource requirements which apply to each individual container created as part of the service.
Resources.Limits?LimitDefine resources limits.
Resources.Reservations?ResourceObjectDefine resources reservation.
RestartPolicy?objectSpecification for the restart policy which applies to containers created as part of this service.
RestartPolicy.Condition?"none" | "on-failure" | "any"Condition for restart.
RestartPolicy.Delay?numberDelay between restart attempts.
RestartPolicy.MaxAttempts?numberMaximum attempts to restart a given container before giving up (default value is 0, which is ignored).
RestartPolicy.Window?numberWindows is the time window used to evaluate the restart policy (default value is 0, which is unbounded).
Runtime?stringRuntime is the type of runtime specified for the task executor.