Type Alias: TaskSpec ​
TaskSpec:
object
User modifiable task configuration.
Type declaration ​
Name | Type | Description |
---|---|---|
ContainerSpec ? | object | Container spec for the service. 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 ? | string | The working directory for commands to run in. |
ContainerSpec.DNSConfig ? | object | Specification 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 ? | string | The 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 ? | string | The image name to use for the container |
ContainerSpec.Init ? | boolean | null | 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. |
ContainerSpec.Isolation ? | "default" | "process" | "hyperv" | Isolation technology of the containers running the service. (Windows only) |
ContainerSpec.Labels ? | object | User-defined key/value data. |
ContainerSpec.Mounts ? | Mount [] | Specification for mounts to be added to containers created as part of the service. |
ContainerSpec.OomScoreAdj ? | number | An integer value containing the score given to the container in order to tune OOM killer preferences. |
ContainerSpec.OpenStdin ? | boolean | Open stdin |
ContainerSpec.Privileges ? | object | Security options for the container |
ContainerSpec.Privileges.AppArmor ? | object | Options for configuring AppArmor on the container |
ContainerSpec.Privileges.AppArmor.Mode ? | "default" | "disabled" | - |
ContainerSpec.Privileges.CredentialSpec ? | object | CredentialSpec for managed service account (Windows only) |
ContainerSpec.Privileges.CredentialSpec.Config ? | string | Load 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. CredentialSpec.File , CredentialSpec.Registry , > and CredentialSpec.Config are mutually exclusive. |
ContainerSpec.Privileges.CredentialSpec.File ? | string | Load 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 . CredentialSpec.File , CredentialSpec.Registry , > and CredentialSpec.Config are mutually exclusive. |
ContainerSpec.Privileges.CredentialSpec.Registry ? | string | Load 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 CredentialSpec.File , CredentialSpec.Registry , > and CredentialSpec.Config are mutually exclusive. |
ContainerSpec.Privileges.NoNewPrivileges ? | boolean | Configuration of the no_new_privs bit in the container |
ContainerSpec.Privileges.Seccomp ? | object | Options for configuring seccomp on the container |
ContainerSpec.Privileges.Seccomp.Mode ? | "default" | "unconfined" | "custom" | - |
ContainerSpec.Privileges.Seccomp.Profile ? | string | The custom seccomp profile as a json object |
ContainerSpec.Privileges.SELinuxContext ? | object | SELinux labels of the container |
ContainerSpec.Privileges.SELinuxContext.Disable ? | boolean | Disable SELinux |
ContainerSpec.Privileges.SELinuxContext.Level ? | string | SELinux level label |
ContainerSpec.Privileges.SELinuxContext.Role ? | string | SELinux role label |
ContainerSpec.Privileges.SELinuxContext.Type ? | string | SELinux type label |
ContainerSpec.Privileges.SELinuxContext.User ? | string | SELinux user label |
ContainerSpec.ReadOnly ? | boolean | Mount 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 ? | number | Amount of time to wait for the container to terminate before forcefully killing it. |
ContainerSpec.StopSignal ? | string | Signal to stop the container. |
ContainerSpec.Sysctls ? | object | 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. |
ContainerSpec.TTY ? | boolean | Whether 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 ? | string | The user inside the container. |
ForceUpdate ? | number | A counter that triggers an update even if no relevant parameters have been changed. |
LogDriver ? | object | Specifies 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 ? | object | Read-only spec type for non-swarm containers attached to swarm overlay networks. plugin . NetworkAttachmentSpec is used when the Runtime > field is set to attachment . |
NetworkAttachmentSpec.ContainerID ? | string | ID 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 ? | number | Maximum 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 ? | object | Plugin spec for the service. (Experimental release only.) plugin . NetworkAttachmentSpec is used when the Runtime > field is set to attachment . |
PluginSpec.Disabled ? | boolean | Disable the plugin once scheduled. |
PluginSpec.Name ? | string | The name or 'alias' to use for the plugin. |
PluginSpec.PluginPrivilege ? | PluginPrivilege [] | - |
PluginSpec.Remote ? | string | The plugin image reference to use. |
Resources ? | object | Resource requirements which apply to each individual container created as part of the service. |
Resources.Limits ? | Limit | Define resources limits. |
Resources.Reservations ? | ResourceObject | Define resources reservation. |
RestartPolicy ? | object | Specification 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 ? | number | Delay between restart attempts. |
RestartPolicy.MaxAttempts ? | number | Maximum attempts to restart a given container before giving up (default value is 0, which is ignored). |
RestartPolicy.Window ? | number | Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded). |
Runtime ? | string | Runtime is the type of runtime specified for the task executor. |