Search or ask Docker

ServiceSpec

ServiceSpec schema in Docker Engine API 1.57.

View Markdown

Schema

Type: object

User modifiable configuration for a service.
EndpointSpec

Schema: EndpointSpec

Labels

Type: object

User-defined key/value metadata.
All schema constraints and annotations
{
  "additionalProperties": {
    "type": "string"
  },
  "description": "User-defined key/value metadata.",
  "type": "object"
}
Mode

Type: object

Scheduling mode for the service.
Global

Type: object

All schema constraints and annotations
{
  "type": "object"
}
GlobalJob

Type: object

The mode used for services which run a task to the completed state on each valid node.
All schema constraints and annotations
{
  "description": "The mode used for services which run a task to the completed state\non each valid node.\n",
  "type": "object"
}
Replicated

Type: object

Replicas

Type: integer

All schema constraints and annotations
{
  "format": "int64",
  "type": "integer"
}
All schema constraints and annotations
{
  "properties": {
    "Replicas": {
      "format": "int64",
      "type": "integer"
    }
  },
  "type": "object"
}
ReplicatedJob

Type: object

The mode used for services with a finite number of tasks that run to a completed state.
MaxConcurrent

Type: integer

The maximum number of replicas to run simultaneously.
All schema constraints and annotations
{
  "default": 1,
  "description": "The maximum number of replicas to run simultaneously.\n",
  "format": "int64",
  "type": "integer"
}
TotalCompletions

Type: integer

The total number of replicas desired to reach the Completed state. If unset, will default to the value of MaxConcurrent
All schema constraints and annotations
{
  "description": "The total number of replicas desired to reach the Completed\nstate. If unset, will default to the value of `MaxConcurrent`\n",
  "format": "int64",
  "type": "integer"
}
All schema constraints and annotations
{
  "description": "The mode used for services with a finite number of tasks that run\nto a completed state.\n",
  "properties": {
    "MaxConcurrent": {
      "default": 1,
      "description": "The maximum number of replicas to run simultaneously.\n",
      "format": "int64",
      "type": "integer"
    },
    "TotalCompletions": {
      "description": "The total number of replicas desired to reach the Completed\nstate. If unset, will default to the value of `MaxConcurrent`\n",
      "format": "int64",
      "type": "integer"
    }
  },
  "type": "object"
}
All schema constraints and annotations
{
  "description": "Scheduling mode for the service.",
  "properties": {
    "Global": {
      "type": "object"
    },
    "GlobalJob": {
      "description": "The mode used for services which run a task to the completed state\non each valid node.\n",
      "type": "object"
    },
    "Replicated": {
      "properties": {
        "Replicas": {
          "format": "int64",
          "type": "integer"
        }
      },
      "type": "object"
    },
    "ReplicatedJob": {
      "description": "The mode used for services with a finite number of tasks that run\nto a completed state.\n",
      "properties": {
        "MaxConcurrent": {
          "default": 1,
          "description": "The maximum number of replicas to run simultaneously.\n",
          "format": "int64",
          "type": "integer"
        },
        "TotalCompletions": {
          "description": "The total number of replicas desired to reach the Completed\nstate. If unset, will default to the value of `MaxConcurrent`\n",
          "format": "int64",
          "type": "integer"
        }
      },
      "type": "object"
    }
  },
  "type": "object"
}
Name

Type: string

Name of the service.
All schema constraints and annotations
{
  "description": "Name of the service.",
  "type": "string"
}
Networks

Type: array

Specifies which networks the service should attach to.

Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead.

Array item

Schema: NetworkAttachmentConfig

All schema constraints and annotations
{
  "description": "Specifies which networks the service should attach to.\n\nDeprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead.\n",
  "items": {
    "$ref": "#/components/schemas/NetworkAttachmentConfig"
  },
  "type": "array"
}
RollbackConfig

Type: object

Specification for the rollback strategy of the service.
Delay

Type: integer

Amount of time between rollback iterations, in nanoseconds.
All schema constraints and annotations
{
  "description": "Amount of time between rollback iterations, in nanoseconds.\n",
  "format": "int64",
  "type": "integer"
}
FailureAction

Type: string

Action to take if an rolled back task fails to run, or stops running during the rollback.
All schema constraints and annotations
{
  "description": "Action to take if an rolled back task fails to run, or stops\nrunning during the rollback.\n",
  "enum": [
    "continue",
    "pause"
  ],
  "type": "string"
}
MaxFailureRatio

Type: number

The fraction of tasks that may fail during a rollback before the failure action is invoked, specified as a floating point number between 0 and 1.
All schema constraints and annotations
{
  "default": 0,
  "description": "The fraction of tasks that may fail during a rollback before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n",
  "type": "number"
}
Monitor

Type: integer

Amount of time to monitor each rolled back task for failures, in nanoseconds.
All schema constraints and annotations
{
  "description": "Amount of time to monitor each rolled back task for failures, in\nnanoseconds.\n",
  "format": "int64",
  "type": "integer"
}
Order

Type: string

The order of operations when rolling back a task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down.
All schema constraints and annotations
{
  "description": "The order of operations when rolling back a task. Either the old\ntask is shut down before the new task is started, or the new task\nis started before the old task is shut down.\n",
  "enum": [
    "stop-first",
    "start-first"
  ],
  "type": "string"
}
Parallelism

Type: integer

Maximum number of tasks to be rolled back in one iteration (0 means unlimited parallelism).
All schema constraints and annotations
{
  "description": "Maximum number of tasks to be rolled back in one iteration (0 means\nunlimited parallelism).\n",
  "format": "int64",
  "type": "integer"
}
All schema constraints and annotations
{
  "description": "Specification for the rollback strategy of the service.",
  "properties": {
    "Delay": {
      "description": "Amount of time between rollback iterations, in nanoseconds.\n",
      "format": "int64",
      "type": "integer"
    },
    "FailureAction": {
      "description": "Action to take if an rolled back task fails to run, or stops\nrunning during the rollback.\n",
      "enum": [
        "continue",
        "pause"
      ],
      "type": "string"
    },
    "MaxFailureRatio": {
      "default": 0,
      "description": "The fraction of tasks that may fail during a rollback before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n",
      "type": "number"
    },
    "Monitor": {
      "description": "Amount of time to monitor each rolled back task for failures, in\nnanoseconds.\n",
      "format": "int64",
      "type": "integer"
    },
    "Order": {
      "description": "The order of operations when rolling back a task. Either the old\ntask is shut down before the new task is started, or the new task\nis started before the old task is shut down.\n",
      "enum": [
        "stop-first",
        "start-first"
      ],
      "type": "string"
    },
    "Parallelism": {
      "description": "Maximum number of tasks to be rolled back in one iteration (0 means\nunlimited parallelism).\n",
      "format": "int64",
      "type": "integer"
    }
  },
  "type": "object"
}
TaskTemplate

Schema: TaskSpec

UpdateConfig

Type: object

Specification for the update strategy of the service.
Delay

Type: integer

Amount of time between updates, in nanoseconds.
All schema constraints and annotations
{
  "description": "Amount of time between updates, in nanoseconds.",
  "format": "int64",
  "type": "integer"
}
FailureAction

Type: string

Action to take if an updated task fails to run, or stops running during the update.
All schema constraints and annotations
{
  "description": "Action to take if an updated task fails to run, or stops running\nduring the update.\n",
  "enum": [
    "continue",
    "pause",
    "rollback"
  ],
  "type": "string"
}
MaxFailureRatio

Type: number

The fraction of tasks that may fail during an update before the failure action is invoked, specified as a floating point number between 0 and 1.
All schema constraints and annotations
{
  "default": 0,
  "description": "The fraction of tasks that may fail during an update before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n",
  "type": "number"
}
Monitor

Type: integer

Amount of time to monitor each updated task for failures, in nanoseconds.
All schema constraints and annotations
{
  "description": "Amount of time to monitor each updated task for failures, in\nnanoseconds.\n",
  "format": "int64",
  "type": "integer"
}
Order

Type: string

The order of operations when rolling out an updated task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down.
All schema constraints and annotations
{
  "description": "The order of operations when rolling out an updated task. Either\nthe old task is shut down before the new task is started, or the\nnew task is started before the old task is shut down.\n",
  "enum": [
    "stop-first",
    "start-first"
  ],
  "type": "string"
}
Parallelism

Type: integer

Maximum number of tasks to be updated in one iteration (0 means unlimited parallelism).
All schema constraints and annotations
{
  "description": "Maximum number of tasks to be updated in one iteration (0 means\nunlimited parallelism).\n",
  "format": "int64",
  "type": "integer"
}
All schema constraints and annotations
{
  "description": "Specification for the update strategy of the service.",
  "properties": {
    "Delay": {
      "description": "Amount of time between updates, in nanoseconds.",
      "format": "int64",
      "type": "integer"
    },
    "FailureAction": {
      "description": "Action to take if an updated task fails to run, or stops running\nduring the update.\n",
      "enum": [
        "continue",
        "pause",
        "rollback"
      ],
      "type": "string"
    },
    "MaxFailureRatio": {
      "default": 0,
      "description": "The fraction of tasks that may fail during an update before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n",
      "type": "number"
    },
    "Monitor": {
      "description": "Amount of time to monitor each updated task for failures, in\nnanoseconds.\n",
      "format": "int64",
      "type": "integer"
    },
    "Order": {
      "description": "The order of operations when rolling out an updated task. Either\nthe old task is shut down before the new task is started, or the\nnew task is started before the old task is shut down.\n",
      "enum": [
        "stop-first",
        "start-first"
      ],
      "type": "string"
    },
    "Parallelism": {
      "description": "Maximum number of tasks to be updated in one iteration (0 means\nunlimited parallelism).\n",
      "format": "int64",
      "type": "integer"
    }
  },
  "type": "object"
}
All schema constraints and annotations
{
  "description": "User modifiable configuration for a service.",
  "properties": {
    "EndpointSpec": {
      "$ref": "#/components/schemas/EndpointSpec"
    },
    "Labels": {
      "additionalProperties": {
        "type": "string"
      },
      "description": "User-defined key/value metadata.",
      "type": "object"
    },
    "Mode": {
      "description": "Scheduling mode for the service.",
      "properties": {
        "Global": {
          "type": "object"
        },
        "GlobalJob": {
          "description": "The mode used for services which run a task to the completed state\non each valid node.\n",
          "type": "object"
        },
        "Replicated": {
          "properties": {
            "Replicas": {
              "format": "int64",
              "type": "integer"
            }
          },
          "type": "object"
        },
        "ReplicatedJob": {
          "description": "The mode used for services with a finite number of tasks that run\nto a completed state.\n",
          "properties": {
            "MaxConcurrent": {
              "default": 1,
              "description": "The maximum number of replicas to run simultaneously.\n",
              "format": "int64",
              "type": "integer"
            },
            "TotalCompletions": {
              "description": "The total number of replicas desired to reach the Completed\nstate. If unset, will default to the value of `MaxConcurrent`\n",
              "format": "int64",
              "type": "integer"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    },
    "Name": {
      "description": "Name of the service.",
      "type": "string"
    },
    "Networks": {
      "description": "Specifies which networks the service should attach to.\n\nDeprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead.\n",
      "items": {
        "$ref": "#/components/schemas/NetworkAttachmentConfig"
      },
      "type": "array"
    },
    "RollbackConfig": {
      "description": "Specification for the rollback strategy of the service.",
      "properties": {
        "Delay": {
          "description": "Amount of time between rollback iterations, in nanoseconds.\n",
          "format": "int64",
          "type": "integer"
        },
        "FailureAction": {
          "description": "Action to take if an rolled back task fails to run, or stops\nrunning during the rollback.\n",
          "enum": [
            "continue",
            "pause"
          ],
          "type": "string"
        },
        "MaxFailureRatio": {
          "default": 0,
          "description": "The fraction of tasks that may fail during a rollback before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n",
          "type": "number"
        },
        "Monitor": {
          "description": "Amount of time to monitor each rolled back task for failures, in\nnanoseconds.\n",
          "format": "int64",
          "type": "integer"
        },
        "Order": {
          "description": "The order of operations when rolling back a task. Either the old\ntask is shut down before the new task is started, or the new task\nis started before the old task is shut down.\n",
          "enum": [
            "stop-first",
            "start-first"
          ],
          "type": "string"
        },
        "Parallelism": {
          "description": "Maximum number of tasks to be rolled back in one iteration (0 means\nunlimited parallelism).\n",
          "format": "int64",
          "type": "integer"
        }
      },
      "type": "object"
    },
    "TaskTemplate": {
      "$ref": "#/components/schemas/TaskSpec"
    },
    "UpdateConfig": {
      "description": "Specification for the update strategy of the service.",
      "properties": {
        "Delay": {
          "description": "Amount of time between updates, in nanoseconds.",
          "format": "int64",
          "type": "integer"
        },
        "FailureAction": {
          "description": "Action to take if an updated task fails to run, or stops running\nduring the update.\n",
          "enum": [
            "continue",
            "pause",
            "rollback"
          ],
          "type": "string"
        },
        "MaxFailureRatio": {
          "default": 0,
          "description": "The fraction of tasks that may fail during an update before the\nfailure action is invoked, specified as a floating point number\nbetween 0 and 1.\n",
          "type": "number"
        },
        "Monitor": {
          "description": "Amount of time to monitor each updated task for failures, in\nnanoseconds.\n",
          "format": "int64",
          "type": "integer"
        },
        "Order": {
          "description": "The order of operations when rolling out an updated task. Either\nthe old task is shut down before the new task is started, or the\nnew task is started before the old task is shut down.\n",
          "enum": [
            "stop-first",
            "start-first"
          ],
          "type": "string"
        },
        "Parallelism": {
          "description": "Maximum number of tasks to be updated in one iteration (0 means\nunlimited parallelism).\n",
          "format": "int64",
          "type": "integer"
        }
      },
      "type": "object"
    }
  },
  "type": "object"
}