Schema
Type:
object
ContainerSpec
Type:
object
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 toattachment.
Args
Type:
array
Array item
Type:
string
All schema constraints and annotations
{
"type": "string"
}All schema constraints and annotations
{
"description": "Arguments to the command.",
"items": {
"type": "string"
},
"type": "array"
}CapabilityAdd
Type:
array
Array item
Type:
string
All schema constraints and annotations
{
"type": "string"
}All schema constraints and annotations
{
"description": "A list of kernel capabilities to add to the default set\nfor the container.\n",
"example": [
"CAP_NET_RAW",
"CAP_SYS_ADMIN",
"CAP_SYS_CHROOT",
"CAP_SYSLOG"
],
"items": {
"type": "string"
},
"type": "array"
}CapabilityDrop
Type:
array
Array item
Type:
string
All schema constraints and annotations
{
"type": "string"
}All schema constraints and annotations
{
"description": "A list of kernel capabilities to drop from the default set\nfor the container.\n",
"example": [
"CAP_NET_RAW"
],
"items": {
"type": "string"
},
"type": "array"
}Command
Type:
array
Array item
Type:
string
All schema constraints and annotations
{
"type": "string"
}All schema constraints and annotations
{
"description": "The command to be run in the image.",
"items": {
"type": "string"
},
"type": "array"
}Configs
Type:
array
Array item
Type:
object
All schema constraints and annotations
{
"properties": {
"ConfigID": {
"description": "ConfigID represents the ID of the specific config that we're\nreferencing.\n",
"type": "string"
},
"ConfigName": {
"description": "ConfigName is the name of the config that this references,\nbut this is just provided for lookup/display purposes. The\nconfig in the reference will be identified by its ID.\n",
"type": "string"
},
"File": {
"description": "File represents a specific target that is backed by a file.\n\n\u003cp\u003e\u003cbr /\u003e\u003cp\u003e\n\n\u003e **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive\n",
"properties": {
"GID": {
"description": "GID represents the file GID.",
"type": "string"
},
"Mode": {
"description": "Mode represents the FileMode of the file.",
"format": "uint32",
"type": "integer"
},
"Name": {
"description": "Name represents the final filename in the filesystem.\n",
"type": "string"
},
"UID": {
"description": "UID represents the file UID.",
"type": "string"
}
},
"type": "object"
},
"Runtime": {
"description": "Runtime represents a target that is not mounted into the\ncontainer but is used by the task\n\n\u003cp\u003e\u003cbr /\u003e\u003cp\u003e\n\n\u003e **Note**: `Configs.File` and `Configs.Runtime` are mutually\n\u003e exclusive\n",
"type": "object"
}
},
"type": "object"
}All schema constraints and annotations
{
"description": "Configs contains references to zero or more configs that will be\nexposed to the service.\n",
"items": {
"properties": {
"ConfigID": {
"description": "ConfigID represents the ID of the specific config that we're\nreferencing.\n",
"type": "string"
},
"ConfigName": {
"description": "ConfigName is the name of the config that this references,\nbut this is just provided for lookup/display purposes. The\nconfig in the reference will be identified by its ID.\n",
"type": "string"
},
"File": {
"description": "File represents a specific target that is backed by a file.\n\n\u003cp\u003e\u003cbr /\u003e\u003cp\u003e\n\n\u003e **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive\n",
"properties": {
"GID": {
"description": "GID represents the file GID.",
"type": "string"
},
"Mode": {
"description": "Mode represents the FileMode of the file.",
"format": "uint32",
"type": "integer"
},
"Name": {
"description": "Name represents the final filename in the filesystem.\n",
"type": "string"
},
"UID": {
"description": "UID represents the file UID.",
"type": "string"
}
},
"type": "object"
},
"Runtime": {
"description": "Runtime represents a target that is not mounted into the\ncontainer but is used by the task\n\n\u003cp\u003e\u003cbr /\u003e\u003cp\u003e\n\n\u003e **Note**: `Configs.File` and `Configs.Runtime` are mutually\n\u003e exclusive\n",
"type": "object"
}
},
"type": "object"
},
"type": "array"
}DNSConfig
Type:
object
resolv.conf).Nameservers
Type:
array
All schema constraints and annotations
{
"description": "The IP addresses of the name servers.",
"items": {
"type": "string"
},
"type": "array"
}Options
Type:
array
debug, ndots:3, etc.).All schema constraints and annotations
{
"description": "A list of internal resolver variables to be modified (e.g.,\n`debug`, `ndots:3`, etc.).\n",
"items": {
"type": "string"
},
"type": "array"
}Search
Type:
array
All schema constraints and annotations
{
"description": "A search list for host-name lookup.",
"items": {
"type": "string"
},
"type": "array"
}All schema constraints and annotations
{
"description": "Specification for DNS related configurations in resolver configuration\nfile (`resolv.conf`).\n",
"properties": {
"Nameservers": {
"description": "The IP addresses of the name servers.",
"items": {
"type": "string"
},
"type": "array"
},
"Options": {
"description": "A list of internal resolver variables to be modified (e.g.,\n`debug`, `ndots:3`, etc.).\n",
"items": {
"type": "string"
},
"type": "array"
},
"Search": {
"description": "A search list for host-name lookup.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
}Dir
Type:
string
All schema constraints and annotations
{
"description": "The working directory for commands to run in.",
"type": "string"
}Env
Type:
array
VAR=value.Array item
Type:
string
All schema constraints and annotations
{
"type": "string"
}All schema constraints and annotations
{
"description": "A list of environment variables in the form `VAR=value`.\n",
"items": {
"type": "string"
},
"type": "array"
}Groups
Type:
array
Array item
Type:
string
All schema constraints and annotations
{
"type": "string"
}All schema constraints and annotations
{
"description": "A list of additional groups that the container process will run as.\n",
"items": {
"type": "string"
},
"type": "array"
}Healthcheck
Schema:
HealthConfig
Hostname
Type:
string
All schema constraints and annotations
{
"description": "The hostname to use for the container, as a valid\n[RFC 1123](https://tools.ietf.org/html/rfc1123) hostname.\n",
"type": "string"
}Hosts
Type:
array
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...]
Array item
Type:
string
All schema constraints and annotations
{
"type": "string"
}All schema constraints and annotations
{
"description": "A list of hostname/IP mappings to add to the container's `hosts`\nfile. The format of extra hosts is specified in the\n[hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html)\nman page:\n\n IP_address canonical_hostname [aliases...]\n",
"items": {
"type": "string"
},
"type": "array"
}Image
Type:
string
All schema constraints and annotations
{
"description": "The image name to use for the container",
"type": "string"
}Init
Type:
boolean
All schema constraints and annotations
{
"description": "Run an init inside the container that forwards signals and reaps\nprocesses. This field is omitted if empty, and the default (as\nconfigured on the daemon) is used.\n",
"type": "boolean",
"x-nullable": true
}Isolation
Type:
string
All schema constraints and annotations
{
"description": "Isolation technology of the containers running the service.\n(Windows only)\n",
"enum": [
"default",
"process",
"hyperv",
""
],
"type": "string"
}Labels
Type:
object
All schema constraints and annotations
{
"additionalProperties": {
"type": "string"
},
"description": "User-defined key/value data.",
"type": "object"
}Mounts
Type:
array
Array item
Schema:
Mount
All schema constraints and annotations
{
"$ref": "#/components/schemas/Mount"
}All schema constraints and annotations
{
"description": "Specification for mounts to be added to containers created as part\nof the service.\n",
"items": {
"$ref": "#/components/schemas/Mount"
},
"type": "array"
}OomScoreAdj
Type:
integer
All schema constraints and annotations
{
"description": "An integer value containing the score given to the container in\norder to tune OOM killer preferences.\n",
"example": 0,
"format": "int64",
"type": "integer"
}OpenStdin
Type:
boolean
stdinAll schema constraints and annotations
{
"description": "Open `stdin`",
"type": "boolean"
}Privileges
Type:
object
AppArmor
Type:
object
All schema constraints and annotations
{
"description": "Options for configuring AppArmor on the container",
"properties": {
"Mode": {
"enum": [
"default",
"disabled"
],
"type": "string"
}
},
"type": "object"
}CredentialSpec
Type:
object
All schema constraints and annotations
{
"description": "CredentialSpec for managed service account (Windows only)",
"properties": {
"Config": {
"description": "Load credential spec from a Swarm Config with the given ID.\nThe specified config must also be present in the Configs\nfield with the Runtime property set.\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\n\u003e **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n\u003e and `CredentialSpec.Config` are mutually exclusive.\n",
"example": "0bt9dmxjvjiqermk6xrop3ekq",
"type": "string"
},
"File": {
"description": "Load credential spec from this file. The file is read by\nthe daemon, and must be present in the `CredentialSpecs`\nsubdirectory in the docker data directory, which defaults\nto `C:\\ProgramData\\Docker\\` on Windows.\n\nFor example, specifying `spec.json` loads\n`C:\\ProgramData\\Docker\\CredentialSpecs\\spec.json`.\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\u003e **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n\u003e and `CredentialSpec.Config` are mutually exclusive.\n",
"example": "spec.json",
"type": "string"
},
"Registry": {
"description": "Load credential spec from this value in the Windows\nregistry. The specified registry value must be located in:\n\n`HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Virtualization\\Containers\\CredentialSpecs`\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\n\u003e **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n\u003e and `CredentialSpec.Config` are mutually exclusive.\n",
"type": "string"
}
},
"type": "object"
}NoNewPrivileges
Type:
boolean
All schema constraints and annotations
{
"description": "Configuration of the no_new_privs bit in the container",
"type": "boolean"
}SELinuxContext
Type:
object
All schema constraints and annotations
{
"description": "SELinux labels of the container",
"properties": {
"Disable": {
"description": "Disable SELinux",
"type": "boolean"
},
"Level": {
"description": "SELinux level label",
"type": "string"
},
"Role": {
"description": "SELinux role label",
"type": "string"
},
"Type": {
"description": "SELinux type label",
"type": "string"
},
"User": {
"description": "SELinux user label",
"type": "string"
}
},
"type": "object"
}Seccomp
Type:
object
All schema constraints and annotations
{
"description": "Options for configuring seccomp on the container",
"properties": {
"Mode": {
"enum": [
"default",
"unconfined",
"custom"
],
"type": "string"
},
"Profile": {
"description": "The custom seccomp profile as a json object",
"type": "string"
}
},
"type": "object"
}All schema constraints and annotations
{
"description": "Security options for the container",
"properties": {
"AppArmor": {
"description": "Options for configuring AppArmor on the container",
"properties": {
"Mode": {
"enum": [
"default",
"disabled"
],
"type": "string"
}
},
"type": "object"
},
"CredentialSpec": {
"description": "CredentialSpec for managed service account (Windows only)",
"properties": {
"Config": {
"description": "Load credential spec from a Swarm Config with the given ID.\nThe specified config must also be present in the Configs\nfield with the Runtime property set.\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\n\u003e **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n\u003e and `CredentialSpec.Config` are mutually exclusive.\n",
"example": "0bt9dmxjvjiqermk6xrop3ekq",
"type": "string"
},
"File": {
"description": "Load credential spec from this file. The file is read by\nthe daemon, and must be present in the `CredentialSpecs`\nsubdirectory in the docker data directory, which defaults\nto `C:\\ProgramData\\Docker\\` on Windows.\n\nFor example, specifying `spec.json` loads\n`C:\\ProgramData\\Docker\\CredentialSpecs\\spec.json`.\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\u003e **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n\u003e and `CredentialSpec.Config` are mutually exclusive.\n",
"example": "spec.json",
"type": "string"
},
"Registry": {
"description": "Load credential spec from this value in the Windows\nregistry. The specified registry value must be located in:\n\n`HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Virtualization\\Containers\\CredentialSpecs`\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\n\u003e **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n\u003e and `CredentialSpec.Config` are mutually exclusive.\n",
"type": "string"
}
},
"type": "object"
},
"NoNewPrivileges": {
"description": "Configuration of the no_new_privs bit in the container",
"type": "boolean"
},
"SELinuxContext": {
"description": "SELinux labels of the container",
"properties": {
"Disable": {
"description": "Disable SELinux",
"type": "boolean"
},
"Level": {
"description": "SELinux level label",
"type": "string"
},
"Role": {
"description": "SELinux role label",
"type": "string"
},
"Type": {
"description": "SELinux type label",
"type": "string"
},
"User": {
"description": "SELinux user label",
"type": "string"
}
},
"type": "object"
},
"Seccomp": {
"description": "Options for configuring seccomp on the container",
"properties": {
"Mode": {
"enum": [
"default",
"unconfined",
"custom"
],
"type": "string"
},
"Profile": {
"description": "The custom seccomp profile as a json object",
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}ReadOnly
Type:
boolean
All schema constraints and annotations
{
"description": "Mount the container's root filesystem as read only.",
"type": "boolean"
}Secrets
Type:
array
Array item
Type:
object
All schema constraints and annotations
{
"properties": {
"File": {
"description": "File represents a specific target that is backed by a file.\n",
"properties": {
"GID": {
"description": "GID represents the file GID.",
"type": "string"
},
"Mode": {
"description": "Mode represents the FileMode of the file.",
"format": "uint32",
"type": "integer"
},
"Name": {
"description": "Name represents the final filename in the filesystem.\n",
"type": "string"
},
"UID": {
"description": "UID represents the file UID.",
"type": "string"
}
},
"type": "object"
},
"SecretID": {
"description": "SecretID represents the ID of the specific secret that we're\nreferencing.\n",
"type": "string"
},
"SecretName": {
"description": "SecretName is the name of the secret that this references,\nbut this is just provided for lookup/display purposes. The\nsecret in the reference will be identified by its ID.\n",
"type": "string"
}
},
"type": "object"
}All schema constraints and annotations
{
"description": "Secrets contains references to zero or more secrets that will be\nexposed to the service.\n",
"items": {
"properties": {
"File": {
"description": "File represents a specific target that is backed by a file.\n",
"properties": {
"GID": {
"description": "GID represents the file GID.",
"type": "string"
},
"Mode": {
"description": "Mode represents the FileMode of the file.",
"format": "uint32",
"type": "integer"
},
"Name": {
"description": "Name represents the final filename in the filesystem.\n",
"type": "string"
},
"UID": {
"description": "UID represents the file UID.",
"type": "string"
}
},
"type": "object"
},
"SecretID": {
"description": "SecretID represents the ID of the specific secret that we're\nreferencing.\n",
"type": "string"
},
"SecretName": {
"description": "SecretName is the name of the secret that this references,\nbut this is just provided for lookup/display purposes. The\nsecret in the reference will be identified by its ID.\n",
"type": "string"
}
},
"type": "object"
},
"type": "array"
}StopGracePeriod
Type:
integer
All schema constraints and annotations
{
"description": "Amount of time to wait for the container to terminate before\nforcefully killing it.\n",
"format": "int64",
"type": "integer"
}StopSignal
Type:
string
All schema constraints and annotations
{
"description": "Signal to stop the container.",
"type": "string"
}Sysctls
Type:
object
All schema constraints and annotations
{
"additionalProperties": {
"type": "string"
},
"description": "Set kernel namedspaced parameters (sysctls) in the container.\nThe Sysctls option on services accepts the same sysctls as the\nare supported on containers. Note that while the same sysctls are\nsupported, no guarantees or checks are made about their\nsuitability for a clustered environment, and it's up to the user\nto determine whether a given sysctl will work properly in a\nService.\n",
"type": "object"
}TTY
Type:
boolean
All schema constraints and annotations
{
"description": "Whether a pseudo-TTY should be allocated.",
"type": "boolean"
}Ulimits
Type:
array
{"Name": "nofile", "Soft": 1024, "Hard": 2048}"Array item
Type:
object
All schema constraints and annotations
{
"properties": {
"Hard": {
"description": "Hard limit",
"type": "integer"
},
"Name": {
"description": "Name of ulimit",
"type": "string"
},
"Soft": {
"description": "Soft limit",
"type": "integer"
}
},
"type": "object"
}All schema constraints and annotations
{
"description": "A list of resource limits to set in the container. For example: `{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}`\"\n",
"items": {
"properties": {
"Hard": {
"description": "Hard limit",
"type": "integer"
},
"Name": {
"description": "Name of ulimit",
"type": "string"
},
"Soft": {
"description": "Soft limit",
"type": "integer"
}
},
"type": "object"
},
"type": "array"
}User
Type:
string
All schema constraints and annotations
{
"description": "The user inside the container.",
"type": "string"
}All schema constraints and annotations
{
"description": "Container spec for the service.\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\u003e **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n\u003e mutually exclusive. PluginSpec is only used when the Runtime field\n\u003e is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n\u003e field is set to `attachment`.\n",
"properties": {
"Args": {
"description": "Arguments to the command.",
"items": {
"type": "string"
},
"type": "array"
},
"CapabilityAdd": {
"description": "A list of kernel capabilities to add to the default set\nfor the container.\n",
"example": [
"CAP_NET_RAW",
"CAP_SYS_ADMIN",
"CAP_SYS_CHROOT",
"CAP_SYSLOG"
],
"items": {
"type": "string"
},
"type": "array"
},
"CapabilityDrop": {
"description": "A list of kernel capabilities to drop from the default set\nfor the container.\n",
"example": [
"CAP_NET_RAW"
],
"items": {
"type": "string"
},
"type": "array"
},
"Command": {
"description": "The command to be run in the image.",
"items": {
"type": "string"
},
"type": "array"
},
"Configs": {
"description": "Configs contains references to zero or more configs that will be\nexposed to the service.\n",
"items": {
"properties": {
"ConfigID": {
"description": "ConfigID represents the ID of the specific config that we're\nreferencing.\n",
"type": "string"
},
"ConfigName": {
"description": "ConfigName is the name of the config that this references,\nbut this is just provided for lookup/display purposes. The\nconfig in the reference will be identified by its ID.\n",
"type": "string"
},
"File": {
"description": "File represents a specific target that is backed by a file.\n\n\u003cp\u003e\u003cbr /\u003e\u003cp\u003e\n\n\u003e **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive\n",
"properties": {
"GID": {
"description": "GID represents the file GID.",
"type": "string"
},
"Mode": {
"description": "Mode represents the FileMode of the file.",
"format": "uint32",
"type": "integer"
},
"Name": {
"description": "Name represents the final filename in the filesystem.\n",
"type": "string"
},
"UID": {
"description": "UID represents the file UID.",
"type": "string"
}
},
"type": "object"
},
"Runtime": {
"description": "Runtime represents a target that is not mounted into the\ncontainer but is used by the task\n\n\u003cp\u003e\u003cbr /\u003e\u003cp\u003e\n\n\u003e **Note**: `Configs.File` and `Configs.Runtime` are mutually\n\u003e exclusive\n",
"type": "object"
}
},
"type": "object"
},
"type": "array"
},
"DNSConfig": {
"description": "Specification for DNS related configurations in resolver configuration\nfile (`resolv.conf`).\n",
"properties": {
"Nameservers": {
"description": "The IP addresses of the name servers.",
"items": {
"type": "string"
},
"type": "array"
},
"Options": {
"description": "A list of internal resolver variables to be modified (e.g.,\n`debug`, `ndots:3`, etc.).\n",
"items": {
"type": "string"
},
"type": "array"
},
"Search": {
"description": "A search list for host-name lookup.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"Dir": {
"description": "The working directory for commands to run in.",
"type": "string"
},
"Env": {
"description": "A list of environment variables in the form `VAR=value`.\n",
"items": {
"type": "string"
},
"type": "array"
},
"Groups": {
"description": "A list of additional groups that the container process will run as.\n",
"items": {
"type": "string"
},
"type": "array"
},
"Healthcheck": {
"$ref": "#/components/schemas/HealthConfig"
},
"Hostname": {
"description": "The hostname to use for the container, as a valid\n[RFC 1123](https://tools.ietf.org/html/rfc1123) hostname.\n",
"type": "string"
},
"Hosts": {
"description": "A list of hostname/IP mappings to add to the container's `hosts`\nfile. The format of extra hosts is specified in the\n[hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html)\nman page:\n\n IP_address canonical_hostname [aliases...]\n",
"items": {
"type": "string"
},
"type": "array"
},
"Image": {
"description": "The image name to use for the container",
"type": "string"
},
"Init": {
"description": "Run an init inside the container that forwards signals and reaps\nprocesses. This field is omitted if empty, and the default (as\nconfigured on the daemon) is used.\n",
"type": "boolean",
"x-nullable": true
},
"Isolation": {
"description": "Isolation technology of the containers running the service.\n(Windows only)\n",
"enum": [
"default",
"process",
"hyperv",
""
],
"type": "string"
},
"Labels": {
"additionalProperties": {
"type": "string"
},
"description": "User-defined key/value data.",
"type": "object"
},
"Mounts": {
"description": "Specification for mounts to be added to containers created as part\nof the service.\n",
"items": {
"$ref": "#/components/schemas/Mount"
},
"type": "array"
},
"OomScoreAdj": {
"description": "An integer value containing the score given to the container in\norder to tune OOM killer preferences.\n",
"example": 0,
"format": "int64",
"type": "integer"
},
"OpenStdin": {
"description": "Open `stdin`",
"type": "boolean"
},
"Privileges": {
"description": "Security options for the container",
"properties": {
"AppArmor": {
"description": "Options for configuring AppArmor on the container",
"properties": {
"Mode": {
"enum": [
"default",
"disabled"
],
"type": "string"
}
},
"type": "object"
},
"CredentialSpec": {
"description": "CredentialSpec for managed service account (Windows only)",
"properties": {
"Config": {
"description": "Load credential spec from a Swarm Config with the given ID.\nThe specified config must also be present in the Configs\nfield with the Runtime property set.\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\n\u003e **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n\u003e and `CredentialSpec.Config` are mutually exclusive.\n",
"example": "0bt9dmxjvjiqermk6xrop3ekq",
"type": "string"
},
"File": {
"description": "Load credential spec from this file. The file is read by\nthe daemon, and must be present in the `CredentialSpecs`\nsubdirectory in the docker data directory, which defaults\nto `C:\\ProgramData\\Docker\\` on Windows.\n\nFor example, specifying `spec.json` loads\n`C:\\ProgramData\\Docker\\CredentialSpecs\\spec.json`.\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\u003e **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n\u003e and `CredentialSpec.Config` are mutually exclusive.\n",
"example": "spec.json",
"type": "string"
},
"Registry": {
"description": "Load credential spec from this value in the Windows\nregistry. The specified registry value must be located in:\n\n`HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Virtualization\\Containers\\CredentialSpecs`\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\n\u003e **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n\u003e and `CredentialSpec.Config` are mutually exclusive.\n",
"type": "string"
}
},
"type": "object"
},
"NoNewPrivileges": {
"description": "Configuration of the no_new_privs bit in the container",
"type": "boolean"
},
"SELinuxContext": {
"description": "SELinux labels of the container",
"properties": {
"Disable": {
"description": "Disable SELinux",
"type": "boolean"
},
"Level": {
"description": "SELinux level label",
"type": "string"
},
"Role": {
"description": "SELinux role label",
"type": "string"
},
"Type": {
"description": "SELinux type label",
"type": "string"
},
"User": {
"description": "SELinux user label",
"type": "string"
}
},
"type": "object"
},
"Seccomp": {
"description": "Options for configuring seccomp on the container",
"properties": {
"Mode": {
"enum": [
"default",
"unconfined",
"custom"
],
"type": "string"
},
"Profile": {
"description": "The custom seccomp profile as a json object",
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"ReadOnly": {
"description": "Mount the container's root filesystem as read only.",
"type": "boolean"
},
"Secrets": {
"description": "Secrets contains references to zero or more secrets that will be\nexposed to the service.\n",
"items": {
"properties": {
"File": {
"description": "File represents a specific target that is backed by a file.\n",
"properties": {
"GID": {
"description": "GID represents the file GID.",
"type": "string"
},
"Mode": {
"description": "Mode represents the FileMode of the file.",
"format": "uint32",
"type": "integer"
},
"Name": {
"description": "Name represents the final filename in the filesystem.\n",
"type": "string"
},
"UID": {
"description": "UID represents the file UID.",
"type": "string"
}
},
"type": "object"
},
"SecretID": {
"description": "SecretID represents the ID of the specific secret that we're\nreferencing.\n",
"type": "string"
},
"SecretName": {
"description": "SecretName is the name of the secret that this references,\nbut this is just provided for lookup/display purposes. The\nsecret in the reference will be identified by its ID.\n",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"StopGracePeriod": {
"description": "Amount of time to wait for the container to terminate before\nforcefully killing it.\n",
"format": "int64",
"type": "integer"
},
"StopSignal": {
"description": "Signal to stop the container.",
"type": "string"
},
"Sysctls": {
"additionalProperties": {
"type": "string"
},
"description": "Set kernel namedspaced parameters (sysctls) in the container.\nThe Sysctls option on services accepts the same sysctls as the\nare supported on containers. Note that while the same sysctls are\nsupported, no guarantees or checks are made about their\nsuitability for a clustered environment, and it's up to the user\nto determine whether a given sysctl will work properly in a\nService.\n",
"type": "object"
},
"TTY": {
"description": "Whether a pseudo-TTY should be allocated.",
"type": "boolean"
},
"Ulimits": {
"description": "A list of resource limits to set in the container. For example: `{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}`\"\n",
"items": {
"properties": {
"Hard": {
"description": "Hard limit",
"type": "integer"
},
"Name": {
"description": "Name of ulimit",
"type": "string"
},
"Soft": {
"description": "Soft limit",
"type": "integer"
}
},
"type": "object"
},
"type": "array"
},
"User": {
"description": "The user inside the container.",
"type": "string"
}
},
"type": "object"
}ForceUpdate
Type:
integer
All schema constraints and annotations
{
"description": "A counter that triggers an update even if no relevant parameters have\nbeen changed.\n",
"format": "uint64",
"type": "integer"
}LogDriver
Type:
object
Name
Type:
string
All schema constraints and annotations
{
"type": "string"
}Options
Type:
object
All schema constraints and annotations
{
"additionalProperties": {
"type": "string"
},
"type": "object"
}All schema constraints and annotations
{
"description": "Specifies the log driver to use for tasks created from this spec. If\nnot present, the default one for the swarm will be used, finally\nfalling back to the engine default if not specified.\n",
"properties": {
"Name": {
"type": "string"
},
"Options": {
"additionalProperties": {
"type": "string"
},
"type": "object"
}
},
"type": "object"
}NetworkAttachmentSpec
Type:
object
Read-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 toattachment.
ContainerID
Type:
string
All schema constraints and annotations
{
"description": "ID of the container represented by this task",
"type": "string"
}All schema constraints and annotations
{
"description": "Read-only spec type for non-swarm containers attached to swarm overlay\nnetworks.\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\u003e **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n\u003e mutually exclusive. PluginSpec is only used when the Runtime field\n\u003e is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n\u003e field is set to `attachment`.\n",
"properties": {
"ContainerID": {
"description": "ID of the container represented by this task",
"type": "string"
}
},
"type": "object"
}Networks
Type:
array
Array item
Schema:
NetworkAttachmentConfig
All schema constraints and annotations
{
"description": "Specifies which networks the service should attach to.",
"items": {
"$ref": "#/components/schemas/NetworkAttachmentConfig"
},
"type": "array"
}Placement
Type:
object
Constraints
Type:
array
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 | matches | example |
|---|---|---|
node.id | Node ID | node.id==2ivku8v2gvtg4 |
node.hostname | Node hostname | node.hostname!=node-2 |
node.role | Node role (manager/worker) | node.role==manager |
node.platform.os | Node operating system | node.platform.os==windows |
node.platform.arch | Node architecture | node.platform.arch==x86_64 |
node.labels | User-defined node labels | node.labels.security==high |
engine.labels | Docker Engine's labels | engine.labels.operatingsystem==ubuntu-24.04 |
engine.labels apply to Docker Engine labels like operating system,
drivers, etc. Swarm administrators add node.labels for operational
purposes by using the
node update endpoint.
Array item
Type:
string
All schema constraints and annotations
{
"type": "string"
}All schema constraints and annotations
{
"description": "An array of constraint expressions to limit the set of nodes where\na task can be scheduled. Constraint expressions can either use a\n_match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find\nnodes that satisfy every expression (AND match). Constraints can\nmatch node or Docker Engine labels as follows:\n\nnode attribute | matches | example\n---------------------|--------------------------------|-----------------------------------------------\n`node.id` | Node ID | `node.id==2ivku8v2gvtg4`\n`node.hostname` | Node hostname | `node.hostname!=node-2`\n`node.role` | Node role (`manager`/`worker`) | `node.role==manager`\n`node.platform.os` | Node operating system | `node.platform.os==windows`\n`node.platform.arch` | Node architecture | `node.platform.arch==x86_64`\n`node.labels` | User-defined node labels | `node.labels.security==high`\n`engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04`\n\n`engine.labels` apply to Docker Engine labels like operating system,\ndrivers, etc. Swarm administrators add `node.labels` for operational\npurposes by using the [`node update endpoint`](#operation/NodeUpdate).\n",
"example": [
"node.hostname!=node3.corp.example.com",
"node.role!=manager",
"node.labels.type==production",
"node.platform.os==linux",
"node.platform.arch==x86_64"
],
"items": {
"type": "string"
},
"type": "array"
}MaxReplicas
Type:
integer
All schema constraints and annotations
{
"default": 0,
"description": "Maximum number of replicas for per node (default value is 0, which\nis unlimited)\n",
"format": "int64",
"type": "integer"
}Platforms
Type:
array
Array item
Schema:
Platform
All schema constraints and annotations
{
"$ref": "#/components/schemas/Platform"
}All schema constraints and annotations
{
"description": "Platforms stores all the platforms that the service's image can\nrun on. This field is used in the platform filter for scheduling.\nIf empty, then the platform filter is off, meaning there are no\nscheduling restrictions.\n",
"items": {
"$ref": "#/components/schemas/Platform"
},
"type": "array"
}Preferences
Type:
array
Array item
Type:
object
All schema constraints and annotations
{
"properties": {
"Spread": {
"properties": {
"SpreadDescriptor": {
"description": "label descriptor, such as `engine.labels.az`.\n",
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}All schema constraints and annotations
{
"description": "Preferences provide a way to make the scheduler aware of factors\nsuch as topology. They are provided in order from highest to\nlowest precedence.\n",
"example": [
{
"Spread": {
"SpreadDescriptor": "node.labels.datacenter"
}
},
{
"Spread": {
"SpreadDescriptor": "node.labels.rack"
}
}
],
"items": {
"properties": {
"Spread": {
"properties": {
"SpreadDescriptor": {
"description": "label descriptor, such as `engine.labels.az`.\n",
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"type": "array"
}All schema constraints and annotations
{
"properties": {
"Constraints": {
"description": "An array of constraint expressions to limit the set of nodes where\na task can be scheduled. Constraint expressions can either use a\n_match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find\nnodes that satisfy every expression (AND match). Constraints can\nmatch node or Docker Engine labels as follows:\n\nnode attribute | matches | example\n---------------------|--------------------------------|-----------------------------------------------\n`node.id` | Node ID | `node.id==2ivku8v2gvtg4`\n`node.hostname` | Node hostname | `node.hostname!=node-2`\n`node.role` | Node role (`manager`/`worker`) | `node.role==manager`\n`node.platform.os` | Node operating system | `node.platform.os==windows`\n`node.platform.arch` | Node architecture | `node.platform.arch==x86_64`\n`node.labels` | User-defined node labels | `node.labels.security==high`\n`engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04`\n\n`engine.labels` apply to Docker Engine labels like operating system,\ndrivers, etc. Swarm administrators add `node.labels` for operational\npurposes by using the [`node update endpoint`](#operation/NodeUpdate).\n",
"example": [
"node.hostname!=node3.corp.example.com",
"node.role!=manager",
"node.labels.type==production",
"node.platform.os==linux",
"node.platform.arch==x86_64"
],
"items": {
"type": "string"
},
"type": "array"
},
"MaxReplicas": {
"default": 0,
"description": "Maximum number of replicas for per node (default value is 0, which\nis unlimited)\n",
"format": "int64",
"type": "integer"
},
"Platforms": {
"description": "Platforms stores all the platforms that the service's image can\nrun on. This field is used in the platform filter for scheduling.\nIf empty, then the platform filter is off, meaning there are no\nscheduling restrictions.\n",
"items": {
"$ref": "#/components/schemas/Platform"
},
"type": "array"
},
"Preferences": {
"description": "Preferences provide a way to make the scheduler aware of factors\nsuch as topology. They are provided in order from highest to\nlowest precedence.\n",
"example": [
{
"Spread": {
"SpreadDescriptor": "node.labels.datacenter"
}
},
{
"Spread": {
"SpreadDescriptor": "node.labels.rack"
}
}
],
"items": {
"properties": {
"Spread": {
"properties": {
"SpreadDescriptor": {
"description": "label descriptor, such as `engine.labels.az`.\n",
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}PluginSpec
Type:
object
Plugin 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 toattachment.
Disabled
Type:
boolean
All schema constraints and annotations
{
"description": "Disable the plugin once scheduled.",
"type": "boolean"
}Name
Type:
string
All schema constraints and annotations
{
"description": "The name or 'alias' to use for the plugin.",
"type": "string"
}PluginPrivilege
Type:
array
Array item
Schema:
PluginPrivilege
All schema constraints and annotations
{
"$ref": "#/components/schemas/PluginPrivilege"
}All schema constraints and annotations
{
"items": {
"$ref": "#/components/schemas/PluginPrivilege"
},
"type": "array"
}Remote
Type:
string
All schema constraints and annotations
{
"description": "The plugin image reference to use.",
"type": "string"
}All schema constraints and annotations
{
"description": "Plugin spec for the service. *(Experimental release only.)*\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\u003e **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n\u003e mutually exclusive. PluginSpec is only used when the Runtime field\n\u003e is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n\u003e field is set to `attachment`.\n",
"properties": {
"Disabled": {
"description": "Disable the plugin once scheduled.",
"type": "boolean"
},
"Name": {
"description": "The name or 'alias' to use for the plugin.",
"type": "string"
},
"PluginPrivilege": {
"items": {
"$ref": "#/components/schemas/PluginPrivilege"
},
"type": "array"
},
"Remote": {
"description": "The plugin image reference to use.",
"type": "string"
}
},
"type": "object"
}Resources
Type:
object
Limits
Schema:
Limit
All schema constraints and annotations
{
"$ref": "#/components/schemas/Limit",
"description": "Define resources limits."
}MemorySwappiness
Type:
integer
All schema constraints and annotations
{
"description": "Tune the service's containers' memory swappiness (0 to 100).\nIf not specified, defaults to the containers' OS' default, generally 60,\nor whatever value was predefined in the image.\nSet to -1 to unset a previously set value.\n",
"format": "int64",
"maximum": 100,
"minimum": -1,
"type": "integer",
"x-nullable": true,
"x-omitempty": true
}Reservations
Schema:
ResourceObject
All schema constraints and annotations
{
"$ref": "#/components/schemas/ResourceObject",
"description": "Define resources reservation."
}SwapBytes
Type:
integer
All schema constraints and annotations
{
"description": "Amount of swap in bytes - can only be used together with a memory limit.\nIf not specified, the default behaviour is to grant a swap space twice\nas big as the memory limit.\nSet to -1 to enable unlimited swap.\n",
"format": "int64",
"minimum": -1,
"type": "integer",
"x-nullable": true,
"x-omitempty": true
}All schema constraints and annotations
{
"description": "Resource requirements which apply to each individual container created\nas part of the service.\n",
"properties": {
"Limits": {
"$ref": "#/components/schemas/Limit",
"description": "Define resources limits."
},
"MemorySwappiness": {
"description": "Tune the service's containers' memory swappiness (0 to 100).\nIf not specified, defaults to the containers' OS' default, generally 60,\nor whatever value was predefined in the image.\nSet to -1 to unset a previously set value.\n",
"format": "int64",
"maximum": 100,
"minimum": -1,
"type": "integer",
"x-nullable": true,
"x-omitempty": true
},
"Reservations": {
"$ref": "#/components/schemas/ResourceObject",
"description": "Define resources reservation."
},
"SwapBytes": {
"description": "Amount of swap in bytes - can only be used together with a memory limit.\nIf not specified, the default behaviour is to grant a swap space twice\nas big as the memory limit.\nSet to -1 to enable unlimited swap.\n",
"format": "int64",
"minimum": -1,
"type": "integer",
"x-nullable": true,
"x-omitempty": true
}
},
"type": "object"
}RestartPolicy
Type:
object
Condition
Type:
string
All schema constraints and annotations
{
"description": "Condition for restart.",
"enum": [
"none",
"on-failure",
"any"
],
"type": "string"
}Delay
Type:
integer
All schema constraints and annotations
{
"description": "Delay between restart attempts.",
"format": "int64",
"type": "integer"
}MaxAttempts
Type:
integer
All schema constraints and annotations
{
"default": 0,
"description": "Maximum attempts to restart a given container before giving up\n(default value is 0, which is ignored).\n",
"format": "int64",
"type": "integer"
}Window
Type:
integer
All schema constraints and annotations
{
"default": 0,
"description": "Windows is the time window used to evaluate the restart policy\n(default value is 0, which is unbounded).\n",
"format": "int64",
"type": "integer"
}All schema constraints and annotations
{
"description": "Specification for the restart policy which applies to containers\ncreated as part of this service.\n",
"properties": {
"Condition": {
"description": "Condition for restart.",
"enum": [
"none",
"on-failure",
"any"
],
"type": "string"
},
"Delay": {
"description": "Delay between restart attempts.",
"format": "int64",
"type": "integer"
},
"MaxAttempts": {
"default": 0,
"description": "Maximum attempts to restart a given container before giving up\n(default value is 0, which is ignored).\n",
"format": "int64",
"type": "integer"
},
"Window": {
"default": 0,
"description": "Windows is the time window used to evaluate the restart policy\n(default value is 0, which is unbounded).\n",
"format": "int64",
"type": "integer"
}
},
"type": "object"
}Runtime
Type:
string
All schema constraints and annotations
{
"description": "Runtime is the type of runtime specified for the task executor.\n",
"type": "string"
}All schema constraints and annotations
{
"description": "User modifiable task configuration.",
"properties": {
"ContainerSpec": {
"description": "Container spec for the service.\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\u003e **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n\u003e mutually exclusive. PluginSpec is only used when the Runtime field\n\u003e is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n\u003e field is set to `attachment`.\n",
"properties": {
"Args": {
"description": "Arguments to the command.",
"items": {
"type": "string"
},
"type": "array"
},
"CapabilityAdd": {
"description": "A list of kernel capabilities to add to the default set\nfor the container.\n",
"example": [
"CAP_NET_RAW",
"CAP_SYS_ADMIN",
"CAP_SYS_CHROOT",
"CAP_SYSLOG"
],
"items": {
"type": "string"
},
"type": "array"
},
"CapabilityDrop": {
"description": "A list of kernel capabilities to drop from the default set\nfor the container.\n",
"example": [
"CAP_NET_RAW"
],
"items": {
"type": "string"
},
"type": "array"
},
"Command": {
"description": "The command to be run in the image.",
"items": {
"type": "string"
},
"type": "array"
},
"Configs": {
"description": "Configs contains references to zero or more configs that will be\nexposed to the service.\n",
"items": {
"properties": {
"ConfigID": {
"description": "ConfigID represents the ID of the specific config that we're\nreferencing.\n",
"type": "string"
},
"ConfigName": {
"description": "ConfigName is the name of the config that this references,\nbut this is just provided for lookup/display purposes. The\nconfig in the reference will be identified by its ID.\n",
"type": "string"
},
"File": {
"description": "File represents a specific target that is backed by a file.\n\n\u003cp\u003e\u003cbr /\u003e\u003cp\u003e\n\n\u003e **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive\n",
"properties": {
"GID": {
"description": "GID represents the file GID.",
"type": "string"
},
"Mode": {
"description": "Mode represents the FileMode of the file.",
"format": "uint32",
"type": "integer"
},
"Name": {
"description": "Name represents the final filename in the filesystem.\n",
"type": "string"
},
"UID": {
"description": "UID represents the file UID.",
"type": "string"
}
},
"type": "object"
},
"Runtime": {
"description": "Runtime represents a target that is not mounted into the\ncontainer but is used by the task\n\n\u003cp\u003e\u003cbr /\u003e\u003cp\u003e\n\n\u003e **Note**: `Configs.File` and `Configs.Runtime` are mutually\n\u003e exclusive\n",
"type": "object"
}
},
"type": "object"
},
"type": "array"
},
"DNSConfig": {
"description": "Specification for DNS related configurations in resolver configuration\nfile (`resolv.conf`).\n",
"properties": {
"Nameservers": {
"description": "The IP addresses of the name servers.",
"items": {
"type": "string"
},
"type": "array"
},
"Options": {
"description": "A list of internal resolver variables to be modified (e.g.,\n`debug`, `ndots:3`, etc.).\n",
"items": {
"type": "string"
},
"type": "array"
},
"Search": {
"description": "A search list for host-name lookup.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"Dir": {
"description": "The working directory for commands to run in.",
"type": "string"
},
"Env": {
"description": "A list of environment variables in the form `VAR=value`.\n",
"items": {
"type": "string"
},
"type": "array"
},
"Groups": {
"description": "A list of additional groups that the container process will run as.\n",
"items": {
"type": "string"
},
"type": "array"
},
"Healthcheck": {
"$ref": "#/components/schemas/HealthConfig"
},
"Hostname": {
"description": "The hostname to use for the container, as a valid\n[RFC 1123](https://tools.ietf.org/html/rfc1123) hostname.\n",
"type": "string"
},
"Hosts": {
"description": "A list of hostname/IP mappings to add to the container's `hosts`\nfile. The format of extra hosts is specified in the\n[hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html)\nman page:\n\n IP_address canonical_hostname [aliases...]\n",
"items": {
"type": "string"
},
"type": "array"
},
"Image": {
"description": "The image name to use for the container",
"type": "string"
},
"Init": {
"description": "Run an init inside the container that forwards signals and reaps\nprocesses. This field is omitted if empty, and the default (as\nconfigured on the daemon) is used.\n",
"type": "boolean",
"x-nullable": true
},
"Isolation": {
"description": "Isolation technology of the containers running the service.\n(Windows only)\n",
"enum": [
"default",
"process",
"hyperv",
""
],
"type": "string"
},
"Labels": {
"additionalProperties": {
"type": "string"
},
"description": "User-defined key/value data.",
"type": "object"
},
"Mounts": {
"description": "Specification for mounts to be added to containers created as part\nof the service.\n",
"items": {
"$ref": "#/components/schemas/Mount"
},
"type": "array"
},
"OomScoreAdj": {
"description": "An integer value containing the score given to the container in\norder to tune OOM killer preferences.\n",
"example": 0,
"format": "int64",
"type": "integer"
},
"OpenStdin": {
"description": "Open `stdin`",
"type": "boolean"
},
"Privileges": {
"description": "Security options for the container",
"properties": {
"AppArmor": {
"description": "Options for configuring AppArmor on the container",
"properties": {
"Mode": {
"enum": [
"default",
"disabled"
],
"type": "string"
}
},
"type": "object"
},
"CredentialSpec": {
"description": "CredentialSpec for managed service account (Windows only)",
"properties": {
"Config": {
"description": "Load credential spec from a Swarm Config with the given ID.\nThe specified config must also be present in the Configs\nfield with the Runtime property set.\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\n\u003e **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n\u003e and `CredentialSpec.Config` are mutually exclusive.\n",
"example": "0bt9dmxjvjiqermk6xrop3ekq",
"type": "string"
},
"File": {
"description": "Load credential spec from this file. The file is read by\nthe daemon, and must be present in the `CredentialSpecs`\nsubdirectory in the docker data directory, which defaults\nto `C:\\ProgramData\\Docker\\` on Windows.\n\nFor example, specifying `spec.json` loads\n`C:\\ProgramData\\Docker\\CredentialSpecs\\spec.json`.\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\u003e **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n\u003e and `CredentialSpec.Config` are mutually exclusive.\n",
"example": "spec.json",
"type": "string"
},
"Registry": {
"description": "Load credential spec from this value in the Windows\nregistry. The specified registry value must be located in:\n\n`HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Virtualization\\Containers\\CredentialSpecs`\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\n\u003e **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`,\n\u003e and `CredentialSpec.Config` are mutually exclusive.\n",
"type": "string"
}
},
"type": "object"
},
"NoNewPrivileges": {
"description": "Configuration of the no_new_privs bit in the container",
"type": "boolean"
},
"SELinuxContext": {
"description": "SELinux labels of the container",
"properties": {
"Disable": {
"description": "Disable SELinux",
"type": "boolean"
},
"Level": {
"description": "SELinux level label",
"type": "string"
},
"Role": {
"description": "SELinux role label",
"type": "string"
},
"Type": {
"description": "SELinux type label",
"type": "string"
},
"User": {
"description": "SELinux user label",
"type": "string"
}
},
"type": "object"
},
"Seccomp": {
"description": "Options for configuring seccomp on the container",
"properties": {
"Mode": {
"enum": [
"default",
"unconfined",
"custom"
],
"type": "string"
},
"Profile": {
"description": "The custom seccomp profile as a json object",
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"ReadOnly": {
"description": "Mount the container's root filesystem as read only.",
"type": "boolean"
},
"Secrets": {
"description": "Secrets contains references to zero or more secrets that will be\nexposed to the service.\n",
"items": {
"properties": {
"File": {
"description": "File represents a specific target that is backed by a file.\n",
"properties": {
"GID": {
"description": "GID represents the file GID.",
"type": "string"
},
"Mode": {
"description": "Mode represents the FileMode of the file.",
"format": "uint32",
"type": "integer"
},
"Name": {
"description": "Name represents the final filename in the filesystem.\n",
"type": "string"
},
"UID": {
"description": "UID represents the file UID.",
"type": "string"
}
},
"type": "object"
},
"SecretID": {
"description": "SecretID represents the ID of the specific secret that we're\nreferencing.\n",
"type": "string"
},
"SecretName": {
"description": "SecretName is the name of the secret that this references,\nbut this is just provided for lookup/display purposes. The\nsecret in the reference will be identified by its ID.\n",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"StopGracePeriod": {
"description": "Amount of time to wait for the container to terminate before\nforcefully killing it.\n",
"format": "int64",
"type": "integer"
},
"StopSignal": {
"description": "Signal to stop the container.",
"type": "string"
},
"Sysctls": {
"additionalProperties": {
"type": "string"
},
"description": "Set kernel namedspaced parameters (sysctls) in the container.\nThe Sysctls option on services accepts the same sysctls as the\nare supported on containers. Note that while the same sysctls are\nsupported, no guarantees or checks are made about their\nsuitability for a clustered environment, and it's up to the user\nto determine whether a given sysctl will work properly in a\nService.\n",
"type": "object"
},
"TTY": {
"description": "Whether a pseudo-TTY should be allocated.",
"type": "boolean"
},
"Ulimits": {
"description": "A list of resource limits to set in the container. For example: `{\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048}`\"\n",
"items": {
"properties": {
"Hard": {
"description": "Hard limit",
"type": "integer"
},
"Name": {
"description": "Name of ulimit",
"type": "string"
},
"Soft": {
"description": "Soft limit",
"type": "integer"
}
},
"type": "object"
},
"type": "array"
},
"User": {
"description": "The user inside the container.",
"type": "string"
}
},
"type": "object"
},
"ForceUpdate": {
"description": "A counter that triggers an update even if no relevant parameters have\nbeen changed.\n",
"format": "uint64",
"type": "integer"
},
"LogDriver": {
"description": "Specifies the log driver to use for tasks created from this spec. If\nnot present, the default one for the swarm will be used, finally\nfalling back to the engine default if not specified.\n",
"properties": {
"Name": {
"type": "string"
},
"Options": {
"additionalProperties": {
"type": "string"
},
"type": "object"
}
},
"type": "object"
},
"NetworkAttachmentSpec": {
"description": "Read-only spec type for non-swarm containers attached to swarm overlay\nnetworks.\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\u003e **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n\u003e mutually exclusive. PluginSpec is only used when the Runtime field\n\u003e is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n\u003e field is set to `attachment`.\n",
"properties": {
"ContainerID": {
"description": "ID of the container represented by this task",
"type": "string"
}
},
"type": "object"
},
"Networks": {
"description": "Specifies which networks the service should attach to.",
"items": {
"$ref": "#/components/schemas/NetworkAttachmentConfig"
},
"type": "array"
},
"Placement": {
"properties": {
"Constraints": {
"description": "An array of constraint expressions to limit the set of nodes where\na task can be scheduled. Constraint expressions can either use a\n_match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find\nnodes that satisfy every expression (AND match). Constraints can\nmatch node or Docker Engine labels as follows:\n\nnode attribute | matches | example\n---------------------|--------------------------------|-----------------------------------------------\n`node.id` | Node ID | `node.id==2ivku8v2gvtg4`\n`node.hostname` | Node hostname | `node.hostname!=node-2`\n`node.role` | Node role (`manager`/`worker`) | `node.role==manager`\n`node.platform.os` | Node operating system | `node.platform.os==windows`\n`node.platform.arch` | Node architecture | `node.platform.arch==x86_64`\n`node.labels` | User-defined node labels | `node.labels.security==high`\n`engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04`\n\n`engine.labels` apply to Docker Engine labels like operating system,\ndrivers, etc. Swarm administrators add `node.labels` for operational\npurposes by using the [`node update endpoint`](#operation/NodeUpdate).\n",
"example": [
"node.hostname!=node3.corp.example.com",
"node.role!=manager",
"node.labels.type==production",
"node.platform.os==linux",
"node.platform.arch==x86_64"
],
"items": {
"type": "string"
},
"type": "array"
},
"MaxReplicas": {
"default": 0,
"description": "Maximum number of replicas for per node (default value is 0, which\nis unlimited)\n",
"format": "int64",
"type": "integer"
},
"Platforms": {
"description": "Platforms stores all the platforms that the service's image can\nrun on. This field is used in the platform filter for scheduling.\nIf empty, then the platform filter is off, meaning there are no\nscheduling restrictions.\n",
"items": {
"$ref": "#/components/schemas/Platform"
},
"type": "array"
},
"Preferences": {
"description": "Preferences provide a way to make the scheduler aware of factors\nsuch as topology. They are provided in order from highest to\nlowest precedence.\n",
"example": [
{
"Spread": {
"SpreadDescriptor": "node.labels.datacenter"
}
},
{
"Spread": {
"SpreadDescriptor": "node.labels.rack"
}
}
],
"items": {
"properties": {
"Spread": {
"properties": {
"SpreadDescriptor": {
"description": "label descriptor, such as `engine.labels.az`.\n",
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"PluginSpec": {
"description": "Plugin spec for the service. *(Experimental release only.)*\n\n\u003cp\u003e\u003cbr /\u003e\u003c/p\u003e\n\n\u003e **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are\n\u003e mutually exclusive. PluginSpec is only used when the Runtime field\n\u003e is set to `plugin`. NetworkAttachmentSpec is used when the Runtime\n\u003e field is set to `attachment`.\n",
"properties": {
"Disabled": {
"description": "Disable the plugin once scheduled.",
"type": "boolean"
},
"Name": {
"description": "The name or 'alias' to use for the plugin.",
"type": "string"
},
"PluginPrivilege": {
"items": {
"$ref": "#/components/schemas/PluginPrivilege"
},
"type": "array"
},
"Remote": {
"description": "The plugin image reference to use.",
"type": "string"
}
},
"type": "object"
},
"Resources": {
"description": "Resource requirements which apply to each individual container created\nas part of the service.\n",
"properties": {
"Limits": {
"$ref": "#/components/schemas/Limit",
"description": "Define resources limits."
},
"MemorySwappiness": {
"description": "Tune the service's containers' memory swappiness (0 to 100).\nIf not specified, defaults to the containers' OS' default, generally 60,\nor whatever value was predefined in the image.\nSet to -1 to unset a previously set value.\n",
"format": "int64",
"maximum": 100,
"minimum": -1,
"type": "integer",
"x-nullable": true,
"x-omitempty": true
},
"Reservations": {
"$ref": "#/components/schemas/ResourceObject",
"description": "Define resources reservation."
},
"SwapBytes": {
"description": "Amount of swap in bytes - can only be used together with a memory limit.\nIf not specified, the default behaviour is to grant a swap space twice\nas big as the memory limit.\nSet to -1 to enable unlimited swap.\n",
"format": "int64",
"minimum": -1,
"type": "integer",
"x-nullable": true,
"x-omitempty": true
}
},
"type": "object"
},
"RestartPolicy": {
"description": "Specification for the restart policy which applies to containers\ncreated as part of this service.\n",
"properties": {
"Condition": {
"description": "Condition for restart.",
"enum": [
"none",
"on-failure",
"any"
],
"type": "string"
},
"Delay": {
"description": "Delay between restart attempts.",
"format": "int64",
"type": "integer"
},
"MaxAttempts": {
"default": 0,
"description": "Maximum attempts to restart a given container before giving up\n(default value is 0, which is ignored).\n",
"format": "int64",
"type": "integer"
},
"Window": {
"default": 0,
"description": "Windows is the time window used to evaluate the restart policy\n(default value is 0, which is unbounded).\n",
"format": "int64",
"type": "integer"
}
},
"type": "object"
},
"Runtime": {
"description": "Runtime is the type of runtime specified for the task executor.\n",
"type": "string"
}
},
"type": "object"
}