blob: 7c4b946a759f993691a1530ec82576a1412deafc [file] [log] [blame]
# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API.
#
# This is used for generating API documentation and the types used by the
# client/server. See api/README.md for more information.
#
# Some style notes:
# - This file is used by ReDoc, which allows GitHub Flavored Markdown in
# descriptions.
# - There is no maximum line length, for ease of editing and pretty diffs.
# - operationIds are in the format "NounVerb", with a singular noun.
swagger: "2.0"
schemes:
- "http"
- "https"
produces:
- "application/json"
- "text/plain"
consumes:
- "application/json"
- "text/plain"
basePath: "/v1.30"
info:
title: "Docker Engine API"
version: "1.30"
x-logo:
url: "https://docs.docker.com/images/logo-docker-main.png"
description: |
The Engine API is an HTTP API served by Docker Engine. It is the API the Docker client uses to communicate with the Engine, so everything the Docker client can do can be done with the API.
Most of the client's commands map directly to API endpoints (e.g. `docker ps` is `GET /containers/json`). The notable exception is running containers, which consists of several API calls.
# Errors
The API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format:
```
{
"message": "page not found"
}
```
# Versioning
The API is usually changed in each release of Docker, so API calls are versioned to ensure that clients don't break.
For Docker Engine 17.06, the API version is 1.30. To lock to this version, you prefix the URL with `/v1.30`. For example, calling `/info` is the same as calling `/v1.30/info`.
Engine releases in the near future should support this version of the API, so your client will continue to work even if it is talking to a newer Engine.
In previous versions of Docker, it was possible to access the API without providing a version. This behaviour is now deprecated will be removed in a future version of Docker.
The API uses an open schema model, which means server may add extra properties to responses. Likewise, the server will ignore any extra query parameters and request body properties. When you write clients, you need to ignore additional properties in responses to ensure they do not break when talking to newer Docker daemons.
This documentation is for version 1.30 of the API, which was introduced with Docker 17.06. Use this table to find documentation for previous versions of the API:
Docker version | API version | Changes
----------------|-------------|---------
17.05.x | [1.29](https://docs.docker.com/engine/api/v1.29/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-29-api-changes)
17.04.x | [1.28](https://docs.docker.com/engine/api/v1.28/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-28-api-changes)
17.03.1 | [1.27](https://docs.docker.com/engine/api/v1.27/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-27-api-changes)
1.13.1 & 17.03.0 | [1.26](https://docs.docker.com/engine/api/v1.26/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-26-api-changes)
1.13.0 | [1.25](https://docs.docker.com/engine/api/v1.25/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-25-api-changes)
1.12.x | [1.24](https://docs.docker.com/engine/api/v1.24/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-24-api-changes)
1.11.x | [1.23](https://docs.docker.com/engine/api/v1.23/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-23-api-changes)
1.10.x | [1.22](https://docs.docker.com/engine/api/v1.22/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-22-api-changes)
1.9.x | [1.21](https://docs.docker.com/engine/api/v1.21/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-21-api-changes)
1.8.x | [1.20](https://docs.docker.com/engine/api/v1.20/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-20-api-changes)
1.7.x | [1.19](https://docs.docker.com/engine/api/v1.19/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-19-api-changes)
1.6.x | [1.18](https://docs.docker.com/engine/api/v1.18/) | [API changes](https://docs.docker.com/engine/api/version-history/#v1-18-api-changes)
# Authentication
Authentication for registries is handled client side. The client has to send authentication details to various endpoints that need to communicate with registries, such as `POST /images/(name)/push`. These are sent as `X-Registry-Auth` header as a Base64 encoded (JSON) string with the following structure:
```
{
"username": "string",
"password": "string",
"email": "string",
"serveraddress": "string"
}
```
The `serveraddress` is a domain/IP without a protocol. Throughout this structure, double quotes are required.
If you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth), you can just pass this instead of credentials:
```
{
"identitytoken": "9cbaf023786cd7..."
}
```
# The tags on paths define the menu sections in the ReDoc documentation, so
# the usage of tags must make sense for that:
# - They should be singular, not plural.
# - There should not be too many tags, or the menu becomes unwieldy. For
# example, it is preferable to add a path to the "System" tag instead of
# creating a tag with a single path in it.
# - The order of tags in this list defines the order in the menu.
tags:
# Primary objects
- name: "Container"
x-displayName: "Containers"
description: |
Create and manage containers.
- name: "Image"
x-displayName: "Images"
- name: "Network"
x-displayName: "Networks"
description: |
Networks are user-defined networks that containers can be attached to. See the [networking documentation](https://docs.docker.com/engine/userguide/networking/) for more information.
- name: "Volume"
x-displayName: "Volumes"
description: |
Create and manage persistent storage that can be attached to containers.
- name: "Exec"
x-displayName: "Exec"
description: |
Run new commands inside running containers. See the [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) for more information.
To exec a command in a container, you first need to create an exec instance, then start it. These two API endpoints are wrapped up in a single command-line command, `docker exec`.
# Swarm things
- name: "Swarm"
x-displayName: "Swarm"
description: |
Engines can be clustered together in a swarm. See [the swarm mode documentation](https://docs.docker.com/engine/swarm/) for more information.
- name: "Node"
x-displayName: "Nodes"
description: |
Nodes are instances of the Engine participating in a swarm. Swarm mode must be enabled for these endpoints to work.
- name: "Service"
x-displayName: "Services"
description: |
Services are the definitions of tasks to run on a swarm. Swarm mode must be enabled for these endpoints to work.
- name: "Task"
x-displayName: "Tasks"
description: |
A task is a container running on a swarm. It is the atomic scheduling unit of swarm. Swarm mode must be enabled for these endpoints to work.
- name: "Secret"
x-displayName: "Secrets"
description: |
Secrets are sensitive data that can be used by services. Swarm mode must be enabled for these endpoints to work.
# System things
- name: "Plugin"
x-displayName: "Plugins"
- name: "System"
x-displayName: "System"
definitions:
Port:
type: "object"
description: "An open port on a container"
required: [PrivatePort, Type]
properties:
IP:
type: "string"
format: "ip-address"
PrivatePort:
type: "integer"
format: "uint16"
x-nullable: false
description: "Port on the container"
PublicPort:
type: "integer"
format: "uint16"
description: "Port exposed on the host"
Type:
type: "string"
x-nullable: false
enum: ["tcp", "udp"]
example:
PrivatePort: 8080
PublicPort: 80
Type: "tcp"
MountPoint:
type: "object"
description: "A mount point inside a container"
properties:
Type:
type: "string"
Name:
type: "string"
Source:
type: "string"
Destination:
type: "string"
Driver:
type: "string"
Mode:
type: "string"
RW:
type: "boolean"
Propagation:
type: "string"
DeviceMapping:
type: "object"
description: "A device mapping between the host and container"
properties:
PathOnHost:
type: "string"
PathInContainer:
type: "string"
CgroupPermissions:
type: "string"
example:
PathOnHost: "/dev/deviceName"
PathInContainer: "/dev/deviceName"
CgroupPermissions: "mrw"
ThrottleDevice:
type: "object"
properties:
Path:
description: "Device path"
type: "string"
Rate:
description: "Rate"
type: "integer"
format: "int64"
minimum: 0
Mount:
type: "object"
properties:
Target:
description: "Container path."
type: "string"
Source:
description: "Mount source (e.g. a volume name, a host path)."
type: "string"
Type:
description: |
The mount type. Available types:
- `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container.
- `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed.
- `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs.
type: "string"
enum:
- "bind"
- "volume"
- "tmpfs"
ReadOnly:
description: "Whether the mount should be read-only."
type: "boolean"
Consistency:
description: "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`."
type: "string"
BindOptions:
description: "Optional configuration for the `bind` type."
type: "object"
properties:
Propagation:
description: "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`."
enum:
- "private"
- "rprivate"
- "shared"
- "rshared"
- "slave"
- "rslave"
VolumeOptions:
description: "Optional configuration for the `volume` type."
type: "object"
properties:
NoCopy:
description: "Populate volume with data from the target."
type: "boolean"
default: false
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
DriverConfig:
description: "Map of driver specific options"
type: "object"
properties:
Name:
description: "Name of the driver to use to create the volume."
type: "string"
Options:
description: "key/value map of driver specific options."
type: "object"
additionalProperties:
type: "string"
TmpfsOptions:
description: "Optional configuration for the `tmpfs` type."
type: "object"
properties:
SizeBytes:
description: "The size for the tmpfs mount in bytes."
type: "integer"
format: "int64"
Mode:
description: "The permission mode for the tmpfs mount in an integer."
type: "integer"
RestartPolicy:
description: |
The behavior to apply when the container exits. The default is not to restart.
An ever increasing delay (double the previous delay, starting at 100ms) is added before each restart to prevent flooding the server.
type: "object"
properties:
Name:
type: "string"
description: |
- Empty string means not to restart
- `always` Always restart
- `unless-stopped` Restart always except when the user has manually stopped the container
- `on-failure` Restart only when the container exit code is non-zero
enum:
- ""
- "always"
- "unless-stopped"
- "on-failure"
MaximumRetryCount:
type: "integer"
description: "If `on-failure` is used, the number of times to retry before giving up"
Resources:
description: "A container's resources (cgroups config, ulimits, etc)"
type: "object"
properties:
# Applicable to all platforms
CpuShares:
description: "An integer value representing this container's relative CPU weight versus other containers."
type: "integer"
Memory:
description: "Memory limit in bytes."
type: "integer"
default: 0
# Applicable to UNIX platforms
CgroupParent:
description: "Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist."
type: "string"
BlkioWeight:
description: "Block IO weight (relative weight)."
type: "integer"
minimum: 0
maximum: 1000
BlkioWeightDevice:
description: |
Block IO weight (relative device weight) in the form `[{"Path": "device_path", "Weight": weight}]`.
type: "array"
items:
type: "object"
properties:
Path:
type: "string"
Weight:
type: "integer"
minimum: 0
BlkioDeviceReadBps:
description: |
Limit read rate (bytes per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
type: "array"
items:
$ref: "#/definitions/ThrottleDevice"
BlkioDeviceWriteBps:
description: |
Limit write rate (bytes per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
type: "array"
items:
$ref: "#/definitions/ThrottleDevice"
BlkioDeviceReadIOps:
description: |
Limit read rate (IO per second) from a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
type: "array"
items:
$ref: "#/definitions/ThrottleDevice"
BlkioDeviceWriteIOps:
description: |
Limit write rate (IO per second) to a device, in the form `[{"Path": "device_path", "Rate": rate}]`.
type: "array"
items:
$ref: "#/definitions/ThrottleDevice"
CpuPeriod:
description: "The length of a CPU period in microseconds."
type: "integer"
format: "int64"
CpuQuota:
description: "Microseconds of CPU time that the container can get in a CPU period."
type: "integer"
format: "int64"
CpuRealtimePeriod:
description: "The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks."
type: "integer"
format: "int64"
CpuRealtimeRuntime:
description: "The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks."
type: "integer"
format: "int64"
CpusetCpus:
description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)"
type: "string"
CpusetMems:
description: "Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems."
type: "string"
Devices:
description: "A list of devices to add to the container."
type: "array"
items:
$ref: "#/definitions/DeviceMapping"
DeviceCgroupRules:
description: "a list of cgroup rules to apply to the container"
type: "array"
items:
type: "string"
example: "c 13:* rwm"
DiskQuota:
description: "Disk limit (in bytes)."
type: "integer"
format: "int64"
KernelMemory:
description: "Kernel memory limit in bytes."
type: "integer"
format: "int64"
MemoryReservation:
description: "Memory soft limit in bytes."
type: "integer"
format: "int64"
MemorySwap:
description: "Total memory limit (memory + swap). Set as `-1` to enable unlimited swap."
type: "integer"
format: "int64"
MemorySwappiness:
description: "Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100."
type: "integer"
format: "int64"
minimum: 0
maximum: 100
NanoCPUs:
description: "CPU quota in units of 10<sup>-9</sup> CPUs."
type: "integer"
format: "int64"
OomKillDisable:
description: "Disable OOM Killer for the container."
type: "boolean"
PidsLimit:
description: "Tune a container's pids limit. Set -1 for unlimited."
type: "integer"
format: "int64"
Ulimits:
description: |
A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`"
type: "array"
items:
type: "object"
properties:
Name:
description: "Name of ulimit"
type: "string"
Soft:
description: "Soft limit"
type: "integer"
Hard:
description: "Hard limit"
type: "integer"
# Applicable to Windows
CpuCount:
description: |
The number of usable CPUs (Windows only).
On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last.
type: "integer"
format: "int64"
CpuPercent:
description: |
The usable percentage of the available CPUs (Windows only).
On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last.
type: "integer"
format: "int64"
IOMaximumIOps:
description: "Maximum IOps for the container system drive (Windows only)"
type: "integer"
format: "int64"
IOMaximumBandwidth:
description: "Maximum IO in bytes per second for the container system drive (Windows only)"
type: "integer"
format: "int64"
HealthConfig:
description: "A test to perform to check that the container is healthy."
type: "object"
properties:
Test:
description: |
The test to perform. Possible values are:
- `[]` inherit healthcheck from image or parent image
- `["NONE"]` disable healthcheck
- `["CMD", args...]` exec arguments directly
- `["CMD-SHELL", command]` run command with system's default shell
type: "array"
items:
type: "string"
Interval:
description: "The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit."
type: "integer"
Timeout:
description: "The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit."
type: "integer"
Retries:
description: "The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit."
type: "integer"
StartPeriod:
description: "Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit."
type: "integer"
HostConfig:
description: "Container configuration that depends on the host we are running on"
allOf:
- $ref: "#/definitions/Resources"
- type: "object"
properties:
# Applicable to all platforms
Binds:
type: "array"
description: |
A list of volume bindings for this container. Each volume binding is a string in one of these forms:
- `host-src:container-dest` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path.
- `host-src:container-dest:ro` to make the bind-mount read-only inside the container. Both `host-src`, and `container-dest` must be an _absolute_ path.
- `volume-name:container-dest` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path.
- `volume-name:container-dest:ro` to mount the volume read-only inside the container. `container-dest` must be an _absolute_ path.
items:
type: "string"
ContainerIDFile:
type: "string"
description: "Path to a file where the container ID is written"
LogConfig:
type: "object"
description: "The logging configuration for this container"
properties:
Type:
type: "string"
enum:
- "json-file"
- "syslog"
- "journald"
- "gelf"
- "fluentd"
- "awslogs"
- "splunk"
- "etwlogs"
- "none"
Config:
type: "object"
additionalProperties:
type: "string"
NetworkMode:
type: "string"
description: "Network mode to use for this container. Supported standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. Any other value is taken
as a custom network's name to which this container should connect to."
PortBindings:
type: "object"
description: "A map of exposed container ports and the host port they should map to."
additionalProperties:
type: "object"
properties:
HostIp:
type: "string"
description: "The host IP address"
HostPort:
type: "string"
description: "The host port number, as a string"
RestartPolicy:
$ref: "#/definitions/RestartPolicy"
AutoRemove:
type: "boolean"
description: "Automatically remove the container when the container's process exits. This has no effect if `RestartPolicy` is set."
VolumeDriver:
type: "string"
description: "Driver that this container uses to mount volumes."
VolumesFrom:
type: "array"
description: "A list of volumes to inherit from another container, specified in the form `<container name>[:<ro|rw>]`."
items:
type: "string"
Mounts:
description: "Specification for mounts to be added to the container."
type: "array"
items:
$ref: "#/definitions/Mount"
# Applicable to UNIX platforms
CapAdd:
type: "array"
description: "A list of kernel capabilities to add to the container."
items:
type: "string"
CapDrop:
type: "array"
description: "A list of kernel capabilities to drop from the container."
items:
type: "string"
Dns:
type: "array"
description: "A list of DNS servers for the container to use."
items:
type: "string"
DnsOptions:
type: "array"
description: "A list of DNS options."
items:
type: "string"
DnsSearch:
type: "array"
description: "A list of DNS search domains."
items:
type: "string"
ExtraHosts:
type: "array"
description: |
A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`.
items:
type: "string"
GroupAdd:
type: "array"
description: "A list of additional groups that the container process will run as."
items:
type: "string"
IpcMode:
type: "string"
description: "IPC namespace to use for the container."
Cgroup:
type: "string"
description: "Cgroup to use for the container."
Links:
type: "array"
description: "A list of links for the container in the form `container_name:alias`."
items:
type: "string"
OomScoreAdj:
type: "integer"
description: "An integer value containing the score given to the container in order to tune OOM killer preferences."
PidMode:
type: "string"
description: |
Set the PID (Process) Namespace mode for the container. It can be either:
- `"container:<name|id>"`: joins another container's PID namespace
- `"host"`: use the host's PID namespace inside the container
Privileged:
type: "boolean"
description: "Gives the container full access to the host."
PublishAllPorts:
type: "boolean"
description: "Allocates a random host port for all of a container's exposed ports."
ReadonlyRootfs:
type: "boolean"
description: "Mount the container's root filesystem as read only."
SecurityOpt:
type: "array"
description: "A list of string values to customize labels for MLS
systems, such as SELinux."
items:
type: "string"
StorageOpt:
type: "object"
description: |
Storage driver options for this container, in the form `{"size": "120G"}`.
additionalProperties:
type: "string"
Tmpfs:
type: "object"
description: |
A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options. For example: `{ "/run": "rw,noexec,nosuid,size=65536k" }`.
additionalProperties:
type: "string"
UTSMode:
type: "string"
description: "UTS namespace to use for the container."
UsernsMode:
type: "string"
description: "Sets the usernamespace mode for the container when usernamespace remapping option is enabled."
ShmSize:
type: "integer"
description: "Size of `/dev/shm` in bytes. If omitted, the system uses 64MB."
minimum: 0
Sysctls:
type: "object"
description: |
A list of kernel parameters (sysctls) to set in the container. For example: `{"net.ipv4.ip_forward": "1"}`
additionalProperties:
type: "string"
Runtime:
type: "string"
description: "Runtime to use with this container."
# Applicable to Windows
ConsoleSize:
type: "array"
description: "Initial console size, as an `[height, width]` array. (Windows only)"
minItems: 2
maxItems: 2
items:
type: "integer"
minimum: 0
Isolation:
type: "string"
description: "Isolation technology of the container. (Windows only)"
enum:
- "default"
- "process"
- "hyperv"
ContainerConfig:
description: "Configuration for a container that is portable between hosts"
type: "object"
properties:
Hostname:
description: "The hostname to use for the container, as a valid RFC 1123 hostname."
type: "string"
Domainname:
description: "The domain name to use for the container."
type: "string"
User:
description: "The user that commands are run as inside the container."
type: "string"
AttachStdin:
description: "Whether to attach to `stdin`."
type: "boolean"
default: false
AttachStdout:
description: "Whether to attach to `stdout`."
type: "boolean"
default: true
AttachStderr:
description: "Whether to attach to `stderr`."
type: "boolean"
default: true
ExposedPorts:
description: |
An object mapping ports to an empty object in the form:
`{"<port>/<tcp|udp>": {}}`
type: "object"
additionalProperties:
type: "object"
enum:
- {}
default: {}
Tty:
description: "Attach standard streams to a TTY, including `stdin` if it is not closed."
type: "boolean"
default: false
OpenStdin:
description: "Open `stdin`"
type: "boolean"
default: false
StdinOnce:
description: "Close `stdin` after one attached client disconnects"
type: "boolean"
default: false
Env:
description: |
A list of environment variables to set inside the container in the form `["VAR=value", ...]`. A variable without `=` is removed from the environment, rather than to have an empty value.
type: "array"
items:
type: "string"
Cmd:
description: "Command to run specified as a string or an array of strings."
type:
- "array"
- "string"
items:
type: "string"
Healthcheck:
$ref: "#/definitions/HealthConfig"
ArgsEscaped:
description: "Command is already escaped (Windows only)"
type: "boolean"
Image:
description: "The name of the image to use when creating the container"
type: "string"
Volumes:
description: "An object mapping mount point paths inside the container to empty objects."
type: "object"
properties:
additionalProperties:
type: "object"
enum:
- {}
default: {}
WorkingDir:
description: "The working directory for commands to run in."
type: "string"
Entrypoint:
description: |
The entry point for the container as a string or an array of strings.
If the array consists of exactly one empty string (`[""]`) then the entry point is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`).
type:
- "array"
- "string"
items:
type: "string"
NetworkDisabled:
description: "Disable networking for the container."
type: "boolean"
MacAddress:
description: "MAC address of the container."
type: "string"
OnBuild:
description: "`ONBUILD` metadata that were defined in the image's `Dockerfile`."
type: "array"
items:
type: "string"
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
StopSignal:
description: "Signal to stop a container as a string or unsigned integer."
type: "string"
default: "SIGTERM"
StopTimeout:
description: "Timeout to stop a container in seconds."
type: "integer"
default: 10
Shell:
description: "Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell."
type: "array"
items:
type: "string"
NetworkConfig:
description: "TODO: check is correct"
type: "object"
properties:
Bridge:
type: "string"
Gateway:
type: "string"
Address:
type: "string"
IPPrefixLen:
type: "integer"
MacAddress:
type: "string"
PortMapping:
type: "string"
Ports:
type: "array"
items:
$ref: "#/definitions/Port"
GraphDriverData:
description: "Information about a container's graph driver."
type: "object"
required: [Name, Data]
properties:
Name:
type: "string"
x-nullable: false
Data:
type: "object"
x-nullable: false
additionalProperties:
type: "string"
Image:
type: "object"
required:
- Id
- Parent
- Comment
- Created
- Container
- DockerVersion
- Author
- Architecture
- Os
- Size
- VirtualSize
- GraphDriver
- RootFS
properties:
Id:
type: "string"
x-nullable: false
RepoTags:
type: "array"
items:
type: "string"
RepoDigests:
type: "array"
items:
type: "string"
Parent:
type: "string"
x-nullable: false
Comment:
type: "string"
x-nullable: false
Created:
type: "string"
x-nullable: false
Container:
type: "string"
x-nullable: false
ContainerConfig:
$ref: "#/definitions/ContainerConfig"
DockerVersion:
type: "string"
x-nullable: false
Author:
type: "string"
x-nullable: false
Config:
$ref: "#/definitions/ContainerConfig"
Architecture:
type: "string"
x-nullable: false
Os:
type: "string"
x-nullable: false
OsVersion:
type: "string"
Size:
type: "integer"
format: "int64"
x-nullable: false
VirtualSize:
type: "integer"
format: "int64"
x-nullable: false
GraphDriver:
$ref: "#/definitions/GraphDriverData"
RootFS:
type: "object"
required: [Type]
properties:
Type:
type: "string"
x-nullable: false
Layers:
type: "array"
items:
type: "string"
BaseLayer:
type: "string"
ImageSummary:
type: "object"
required:
- Id
- ParentId
- RepoTags
- RepoDigests
- Created
- Size
- SharedSize
- VirtualSize
- Labels
- Containers
properties:
Id:
type: "string"
x-nullable: false
ParentId:
type: "string"
x-nullable: false
RepoTags:
type: "array"
x-nullable: false
items:
type: "string"
RepoDigests:
type: "array"
x-nullable: false
items:
type: "string"
Created:
type: "integer"
x-nullable: false
Size:
type: "integer"
x-nullable: false
SharedSize:
type: "integer"
x-nullable: false
VirtualSize:
type: "integer"
x-nullable: false
Labels:
type: "object"
x-nullable: false
additionalProperties:
type: "string"
Containers:
x-nullable: false
type: "integer"
AuthConfig:
type: "object"
properties:
username:
type: "string"
password:
type: "string"
email:
type: "string"
serveraddress:
type: "string"
example:
username: "hannibal"
password: "xxxx"
serveraddress: "https://index.docker.io/v1/"
ProcessConfig:
type: "object"
properties:
privileged:
type: "boolean"
user:
type: "string"
tty:
type: "boolean"
entrypoint:
type: "string"
arguments:
type: "array"
items:
type: "string"
Volume:
type: "object"
required: [Name, Driver, Mountpoint, Labels, Scope, Options]
properties:
Name:
type: "string"
description: "Name of the volume."
x-nullable: false
Driver:
type: "string"
description: "Name of the volume driver used by the volume."
x-nullable: false
Mountpoint:
type: "string"
description: "Mount path of the volume on the host."
x-nullable: false
Status:
type: "object"
description: |
Low-level details about the volume, provided by the volume driver.
Details are returned as a map with key/value pairs:
`{"key":"value","key2":"value2"}`.
The `Status` field is optional, and is omitted if the volume driver
does not support this feature.
additionalProperties:
type: "object"
Labels:
type: "object"
description: "User-defined key/value metadata."
x-nullable: false
additionalProperties:
type: "string"
Scope:
type: "string"
description: "The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level."
default: "local"
x-nullable: false
enum: ["local", "global"]
Options:
type: "object"
description: "The driver specific options used when creating the volume."
additionalProperties:
type: "string"
UsageData:
type: "object"
x-nullable: true
required: [Size, RefCount]
description: |
Usage details about the volume. This information is used by the
`GET /system/df` endpoint, and omitted in other endpoints.
properties:
Size:
type: "integer"
default: -1
description: |
Amount of disk space used by the volume (in bytes). This information
is only available for volumes created with the `"local"` volume
driver. For volumes created with other volume drivers, this field
is set to `-1` ("not available")
x-nullable: false
RefCount:
type: "integer"
default: -1
description: |
The number of containers referencing this volume. This field
is set to `-1` if the reference-count is not available.
x-nullable: false
example:
Name: "tardis"
Driver: "custom"
Mountpoint: "/var/lib/docker/volumes/tardis"
Status:
hello: "world"
Labels:
com.example.some-label: "some-value"
com.example.some-other-label: "some-other-value"
Scope: "local"
Network:
type: "object"
properties:
Name:
type: "string"
Id:
type: "string"
Created:
type: "string"
format: "dateTime"
Scope:
type: "string"
Driver:
type: "string"
EnableIPv6:
type: "boolean"
IPAM:
$ref: "#/definitions/IPAM"
Internal:
type: "boolean"
Attachable:
type: "boolean"
Ingress:
type: "boolean"
Containers:
type: "object"
additionalProperties:
$ref: "#/definitions/NetworkContainer"
Options:
type: "object"
additionalProperties:
type: "string"
Labels:
type: "object"
additionalProperties:
type: "string"
example:
Name: "net01"
Id: "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99"
Created: "2016-10-19T04:33:30.360899459Z"
Scope: "local"
Driver: "bridge"
EnableIPv6: false
IPAM:
Driver: "default"
Config:
- Subnet: "172.19.0.0/16"
Gateway: "172.19.0.1"
Options:
foo: "bar"
Internal: false
Attachable: false
Ingress: false
Containers:
19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c:
Name: "test"
EndpointID: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a"
MacAddress: "02:42:ac:13:00:02"
IPv4Address: "172.19.0.2/16"
IPv6Address: ""
Options:
com.docker.network.bridge.default_bridge: "true"
com.docker.network.bridge.enable_icc: "true"
com.docker.network.bridge.enable_ip_masquerade: "true"
com.docker.network.bridge.host_binding_ipv4: "0.0.0.0"
com.docker.network.bridge.name: "docker0"
com.docker.network.driver.mtu: "1500"
Labels:
com.example.some-label: "some-value"
com.example.some-other-label: "some-other-value"
IPAM:
type: "object"
properties:
Driver:
description: "Name of the IPAM driver to use."
type: "string"
default: "default"
Config:
description: "List of IPAM configuration options, specified as a map: `{\"Subnet\": <CIDR>, \"IPRange\": <CIDR>, \"Gateway\": <IP address>, \"AuxAddress\": <device_name:IP address>}`"
type: "array"
items:
type: "object"
additionalProperties:
type: "string"
Options:
description: "Driver-specific options, specified as a map."
type: "array"
items:
type: "object"
additionalProperties:
type: "string"
NetworkContainer:
type: "object"
properties:
Name:
type: "string"
EndpointID:
type: "string"
MacAddress:
type: "string"
IPv4Address:
type: "string"
IPv6Address:
type: "string"
BuildInfo:
type: "object"
properties:
id:
type: "string"
stream:
type: "string"
error:
type: "string"
errorDetail:
$ref: "#/definitions/ErrorDetail"
status:
type: "string"
progress:
type: "string"
progressDetail:
$ref: "#/definitions/ProgressDetail"
CreateImageInfo:
type: "object"
properties:
error:
type: "string"
status:
type: "string"
progress:
type: "string"
progressDetail:
$ref: "#/definitions/ProgressDetail"
PushImageInfo:
type: "object"
properties:
error:
type: "string"
status:
type: "string"
progress:
type: "string"
progressDetail:
$ref: "#/definitions/ProgressDetail"
ErrorDetail:
type: "object"
properties:
code:
type: "integer"
message:
type: "string"
ProgressDetail:
type: "object"
properties:
code:
type: "integer"
message:
type: "integer"
ErrorResponse:
description: "Represents an error."
type: "object"
required: ["message"]
properties:
message:
description: "The error message."
type: "string"
x-nullable: false
example:
message: "Something went wrong."
IdResponse:
description: "Response to an API call that returns just an Id"
type: "object"
required: ["Id"]
properties:
Id:
description: "The id of the newly created object."
type: "string"
x-nullable: false
EndpointSettings:
description: "Configuration for a network endpoint."
type: "object"
properties:
IPAMConfig:
description: "IPAM configurations for the endpoint"
type: "object"
properties:
IPv4Address:
type: "string"
IPv6Address:
type: "string"
LinkLocalIPs:
type: "array"
items:
type: "string"
Links:
type: "array"
items:
type: "string"
Aliases:
type: "array"
items:
type: "string"
NetworkID:
type: "string"
EndpointID:
type: "string"
Gateway:
type: "string"
IPAddress:
type: "string"
IPPrefixLen:
type: "integer"
IPv6Gateway:
type: "string"
GlobalIPv6Address:
type: "string"
GlobalIPv6PrefixLen:
type: "integer"
format: "int64"
MacAddress:
type: "string"
PluginMount:
type: "object"
x-nullable: false
required: [Name, Description, Settable, Source, Destination, Type, Options]
properties:
Name:
type: "string"
x-nullable: false
example: "some-mount"
Description:
type: "string"
x-nullable: false
example: "This is a mount that's used by the plugin."
Settable:
type: "array"
items:
type: "string"
Source:
type: "string"
example: "/var/lib/docker/plugins/"
Destination:
type: "string"
x-nullable: false
example: "/mnt/state"
Type:
type: "string"
x-nullable: false
example: "bind"
Options:
type: "array"
items:
type: "string"
example:
- "rbind"
- "rw"
PluginDevice:
type: "object"
required: [Name, Description, Settable, Path]
x-nullable: false
properties:
Name:
type: "string"
x-nullable: false
Description:
type: "string"
x-nullable: false
Settable:
type: "array"
items:
type: "string"
Path:
type: "string"
example: "/dev/fuse"
PluginEnv:
type: "object"
x-nullable: false
required: [Name, Description, Settable, Value]
properties:
Name:
x-nullable: false
type: "string"
Description:
x-nullable: false
type: "string"
Settable:
type: "array"
items:
type: "string"
Value:
type: "string"
PluginInterfaceType:
type: "object"
x-nullable: false
required: [Prefix, Capability, Version]
properties:
Prefix:
type: "string"
x-nullable: false
Capability:
type: "string"
x-nullable: false
Version:
type: "string"
x-nullable: false
Plugin:
description: "A plugin for the Engine API"
type: "object"
required: [Settings, Enabled, Config, Name]
properties:
Id:
type: "string"
example: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078"
Name:
type: "string"
x-nullable: false
example: "tiborvass/sample-volume-plugin"
Enabled:
description: "True if the plugin is running. False if the plugin is not running, only installed."
type: "boolean"
x-nullable: false
example: true
Settings:
description: "Settings that can be modified by users."
type: "object"
x-nullable: false
required: [Args, Devices, Env, Mounts]
properties:
Mounts:
type: "array"
items:
$ref: "#/definitions/PluginMount"
Env:
type: "array"
items:
type: "string"
example:
- "DEBUG=0"
Args:
type: "array"
items:
type: "string"
Devices:
type: "array"
items:
$ref: "#/definitions/PluginDevice"
PluginReference:
description: "plugin remote reference used to push/pull the plugin"
type: "string"
x-nullable: false
example: "localhost:5000/tiborvass/sample-volume-plugin:latest"
Config:
description: "The config of a plugin."
type: "object"
x-nullable: false
required:
- Description
- Documentation
- Interface
- Entrypoint
- WorkDir
- Network
- Linux
- PidHost
- PropagatedMount
- IpcHost
- Mounts
- Env
- Args
properties:
DockerVersion:
description: "Docker Version used to create the plugin"
type: "string"
x-nullable: false
example: "17.06.0-ce"
Description:
type: "string"
x-nullable: false
example: "A sample volume plugin for Docker"
Documentation:
type: "string"
x-nullable: false
example: "https://docs.docker.com/engine/extend/plugins/"
Interface:
description: "The interface between Docker and the plugin"
x-nullable: false
type: "object"
required: [Types, Socket]
properties:
Types:
type: "array"
items:
$ref: "#/definitions/PluginInterfaceType"
example:
- "docker.volumedriver/1.0"
Socket:
type: "string"
x-nullable: false
example: "plugins.sock"
Entrypoint:
type: "array"
items:
type: "string"
example:
- "/usr/bin/sample-volume-plugin"
- "/data"
WorkDir:
type: "string"
x-nullable: false
example: "/bin/"
User:
type: "object"
x-nullable: false
properties:
UID:
type: "integer"
format: "uint32"
example: 1000
GID:
type: "integer"
format: "uint32"
example: 1000
Network:
type: "object"
x-nullable: false
required: [Type]
properties:
Type:
x-nullable: false
type: "string"
example: "host"
Linux:
type: "object"
x-nullable: false
required: [Capabilities, AllowAllDevices, Devices]
properties:
Capabilities:
type: "array"
items:
type: "string"
example:
- "CAP_SYS_ADMIN"
- "CAP_SYSLOG"
AllowAllDevices:
type: "boolean"
x-nullable: false
example: false
Devices:
type: "array"
items:
$ref: "#/definitions/PluginDevice"
PropagatedMount:
type: "string"
x-nullable: false
example: "/mnt/volumes"
IpcHost:
type: "boolean"
x-nullable: false
example: false
PidHost:
type: "boolean"
x-nullable: false
example: false
Mounts:
type: "array"
items:
$ref: "#/definitions/PluginMount"
Env:
type: "array"
items:
$ref: "#/definitions/PluginEnv"
example:
- Name: "DEBUG"
Description: "If set, prints debug messages"
Settable: null
Value: "0"
Args:
type: "object"
x-nullable: false
required: [Name, Description, Settable, Value]
properties:
Name:
x-nullable: false
type: "string"
example: "args"
Description:
x-nullable: false
type: "string"
example: "command line arguments"
Settable:
type: "array"
items:
type: "string"
Value:
type: "array"
items:
type: "string"
rootfs:
type: "object"
properties:
type:
type: "string"
example: "layers"
diff_ids:
type: "array"
items:
type: "string"
example:
- "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887"
- "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8"
ObjectVersion:
description: |
The version number of the object such as node, service, etc. This is needed to avoid conflicting writes.
The client must send the version number along with the modified specification when updating these objects.
This approach ensures safe concurrency and determinism in that the change on the object
may not be applied if the version number has changed from the last read. In other words,
if two update requests specify the same base version, only one of the requests can succeed.
As a result, two separate update requests that happen at the same time will not
unintentially overwrite each other.
type: "object"
properties:
Index:
type: "integer"
format: "int64"
NodeSpec:
type: "object"
properties:
Name:
description: "Name for the node."
type: "string"
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
Role:
description: "Role of the node."
type: "string"
enum:
- "worker"
- "manager"
Availability:
description: "Availability of the node."
type: "string"
enum:
- "active"
- "pause"
- "drain"
example:
Availability: "active"
Name: "node-name"
Role: "manager"
Labels:
foo: "bar"
Node:
type: "object"
properties:
ID:
type: "string"
Version:
$ref: "#/definitions/ObjectVersion"
CreatedAt:
type: "string"
format: "dateTime"
UpdatedAt:
type: "string"
format: "dateTime"
Spec:
$ref: "#/definitions/NodeSpec"
Description:
type: "object"
properties:
Hostname:
type: "string"
Platform:
type: "object"
properties:
Architecture:
type: "string"
OS:
type: "string"
Resources:
type: "object"
properties:
NanoCPUs:
type: "integer"
format: "int64"
MemoryBytes:
type: "integer"
format: "int64"
Engine:
type: "object"
properties:
EngineVersion:
type: "string"
Labels:
type: "object"
additionalProperties:
type: "string"
Plugins:
type: "array"
items:
type: "object"
properties:
Type:
type: "string"
Name:
type: "string"
TLSInfo:
$ref: "#/definitions/SwarmSpec"
example:
ID: "24ifsmvkjbyhk"
Version:
Index: 8
CreatedAt: "2016-06-07T20:31:11.853781916Z"
UpdatedAt: "2016-06-07T20:31:11.999868824Z"
Spec:
Name: "my-node"
Role: "manager"
Availability: "active"
Labels:
foo: "bar"
Description:
Hostname: "bf3067039e47"
Platform:
Architecture: "x86_64"
OS: "linux"
Resources:
NanoCPUs: 4000000000
MemoryBytes: 8272408576
Engine:
EngineVersion: "17.04.0"
Labels:
foo: "bar"
Plugins:
- Type: "Volume"
Name: "local"
- Type: "Network"
Name: "bridge"
- Type: "Network"
Name: "null"
- Type: "Network"
Name: "overlay"
Status:
State: "ready"
Addr: "172.17.0.2"
ManagerStatus:
Leader: true
Reachability: "reachable"
Addr: "172.17.0.2:2377"
TLSInfo:
TrustRoot: |
-----BEGIN CERTIFICATE-----
MIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw
EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0
MzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH
A0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf
3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB
Af8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO
PQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz
pxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H
-----END CERTIFICATE-----
CertIssuerSubject: "MBMxETAPBgNVBAMTCHN3YXJtLWNh"
CertIssuerPublicKey: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A=="
TLSInfo:
description: "Information about the issuer of leaf TLS certificates and the trusted root CA certificate"
type: "object"
properties:
TrustRoot:
description: "The root CA certificate(s) that are used to validate leaf TLS certificates"
type: "string"
CertIssuerSubject:
description: "The base64-url-safe-encoded raw subject bytes of the issuer"
type: "string"
CertIssuerPublicKey:
description: "The base64-url-safe-encoded raw public key bytes of the issuer"
type: "string"
example:
TrustRoot: |
-----BEGIN CERTIFICATE-----
MIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw
EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0
MzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH
A0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf
3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB
Af8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO
PQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz
pxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H
-----END CERTIFICATE-----
CertIssuerSubject: "MBMxETAPBgNVBAMTCHN3YXJtLWNh"
CertIssuerPublicKey: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A=="
SwarmSpec:
description: "User modifiable swarm configuration."
type: "object"
properties:
Name:
description: "Name of the swarm."
type: "string"
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
Orchestration:
description: "Orchestration configuration."
type: "object"
properties:
TaskHistoryRetentionLimit:
description: "The number of historic tasks to keep per instance or node. If negative, never remove completed or failed tasks."
type: "integer"
format: "int64"
Raft:
description: "Raft configuration."
type: "object"
properties:
SnapshotInterval:
description: "The number of log entries between snapshots."
type: "integer"
format: "int64"
KeepOldSnapshots:
description: "The number of snapshots to keep beyond the current snapshot."
type: "integer"
format: "int64"
LogEntriesForSlowFollowers:
description: "The number of log entries to keep around to sync up slow followers after a snapshot is created."
type: "integer"
format: "int64"
ElectionTick:
description: |
The number of ticks that a follower will wait for a message from the leader before becoming a candidate and starting an election. `ElectionTick` must be greater than `HeartbeatTick`.
A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed.
type: "integer"
HeartbeatTick:
description: |
The number of ticks between heartbeats. Every HeartbeatTick ticks, the leader will send a heartbeat to the followers.
A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed.
type: "integer"
Dispatcher:
description: "Dispatcher configuration."
type: "object"
properties:
HeartbeatPeriod:
description: "The delay for an agent to send a heartbeat to the dispatcher."
type: "integer"
format: "int64"
CAConfig:
description: "CA configuration."
type: "object"
properties:
NodeCertExpiry:
description: "The duration node certificates are issued for."
type: "integer"
format: "int64"
ExternalCAs:
description: "Configuration for forwarding signing requests to an external certificate authority."
type: "array"
items:
type: "object"
properties:
Protocol:
description: "Protocol for communication with the external CA (currently only `cfssl` is supported)."
type: "string"
enum:
- "cfssl"
default: "cfssl"
URL:
description: "URL where certificate signing requests should be sent."
type: "string"
Options:
description: "An object with key/value pairs that are interpreted as protocol-specific options for the external CA driver."
type: "object"
additionalProperties:
type: "string"
CACert:
description: "The root CA certificate (in PEM format) this external CA uses to issue TLS certificates (assumed to be to the current swarm root CA certificate if not provided)."
type: "string"
SigningCACert:
description: "The desired signing CA certificate for all swarm node TLS leaf certificates, in PEM format."
type: "string"
SigningCAKey:
description: "The desired signing CA key for all swarm node TLS leaf certificates, in PEM format."
type: "string"
ForceRotate:
description: "An integer whose purpose is to force swarm to generate a new signing CA certificate and key, if none have been specified in `SigningCACert` and `SigningCAKey`"
EncryptionConfig:
description: "Parameters related to encryption-at-rest."
type: "object"
properties:
AutoLockManagers:
description: "If set, generate a key and use it to lock data stored on the managers."
type: "boolean"
TaskDefaults:
description: "Defaults for creating tasks in this cluster."
type: "object"
properties:
LogDriver:
description: |
The log driver to use for tasks created in the orchestrator if unspecified by a service.
Updating this value will only have an affect on new tasks. Old tasks will continue use their previously configured log driver until recreated.
type: "object"
properties:
Name:
type: "string"
Options:
type: "object"
additionalProperties:
type: "string"
example:
Name: "default"
Orchestration:
TaskHistoryRetentionLimit: 10
Raft:
SnapshotInterval: 10000
LogEntriesForSlowFollowers: 500
HeartbeatTick: 1
ElectionTick: 3
Dispatcher:
HeartbeatPeriod: 5000000000
CAConfig:
NodeCertExpiry: 7776000000000000
JoinTokens:
Worker: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx"
Manager: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2"
EncryptionConfig:
AutoLockManagers: false
# The Swarm information for `GET /info`. It is the same as `GET /swarm`, but
# without `JoinTokens`.
ClusterInfo:
type: "object"
properties:
ID:
description: "The ID of the swarm."
type: "string"
Version:
$ref: "#/definitions/ObjectVersion"
CreatedAt:
type: "string"
format: "dateTime"
UpdatedAt:
type: "string"
format: "dateTime"
Spec:
$ref: "#/definitions/SwarmSpec"
TLSInfo:
$ref: "#/definitions/TLSInfo"
RootRotationInProgress:
description: "Whether there is currently a root CA rotation in progress for the swarm"
type: "boolean"
TaskSpec:
description: "User modifiable task configuration."
type: "object"
properties:
ContainerSpec:
type: "object"
properties:
Image:
description: "The image name to use for the container."
type: "string"
Labels:
description: "User-defined key/value data."
type: "object"
additionalProperties:
type: "string"
Command:
description: "The command to be run in the image."
type: "array"
items:
type: "string"
Args:
description: "Arguments to the command."
type: "array"
items:
type: "string"
Hostname:
description: "The hostname to use for the container, as a valid RFC 1123 hostname."
type: "string"
Env:
description: "A list of environment variables in the form `VAR=value`."
type: "array"
items:
type: "string"
Dir:
description: "The working directory for commands to run in."
type: "string"
User:
description: "The user inside the container."
type: "string"
Groups:
type: "array"
description: "A list of additional groups that the container process will run as."
items:
type: "string"
Privileges:
type: "object"
description: "Security options for the container"
properties:
CredentialSpec:
type: "object"
description: "CredentialSpec for managed service account (Windows only)"
properties:
File:
type: "string"
description: |
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`.
<p><br /></p>
> **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive.
Registry:
type: "string"
description: |
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`
<p><br /></p>
> **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive.
SELinuxContext:
type: "object"
description: "SELinux labels of the container"
properties:
Disable:
type: "boolean"
description: "Disable SELinux"
User:
type: "string"
description: "SELinux user label"
Role:
type: "string"
description: "SELinux role label"
Type:
type: "string"
description: "SELinux type label"
Level:
type: "string"
description: "SELinux level label"
TTY:
description: "Whether a pseudo-TTY should be allocated."
type: "boolean"
OpenStdin:
description: "Open `stdin`"
type: "boolean"
ReadOnly:
description: "Mount the container's root filesystem as read only."
type: "boolean"
Mounts:
description: "Specification for mounts to be added to containers created as part of the service."
type: "array"
items:
$ref: "#/definitions/Mount"
StopSignal:
description: "Signal to stop the container."
type: "string"
StopGracePeriod:
description: "Amount of time to wait for the container to terminate before forcefully killing it."
type: "integer"
format: "int64"
HealthCheck:
$ref: "#/definitions/HealthConfig"
Hosts:
type: "array"
description: |
A list of hostnames/IP mappings to add to the container's `/etc/hosts` file.
The format of extra hosts on swarmkit is specified in:
http://man7.org/linux/man-pages/man5/hosts.5.html
IP_address canonical_hostname [aliases...]
items:
type: "string"
DNSConfig:
description: "Specification for DNS related configurations in resolver configuration file (`resolv.conf`)."
type: "object"
properties:
Nameservers:
description: "The IP addresses of the name servers."
type: "array"
items:
type: "string"
Search:
description: "A search list for host-name lookup."
type: "array"
items:
type: "string"
Options:
description: "A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.)."
type: "array"
items:
type: "string"
Secrets:
description: "Secrets contains references to zero or more secrets that will be exposed to the service."
type: "array"
items:
type: "object"
properties:
File:
description: "File represents a specific target that is backed by a file."
type: "object"
properties:
Name:
description: "Name represents the final filename in the filesystem."
type: "string"
UID:
description: "UID represents the file UID."
type: "string"
GID:
description: "GID represents the file GID."
type: "string"
Mode:
description: "Mode represents the FileMode of the file."
type: "integer"
format: "uint32"
SecretID:
description: "SecretID represents the ID of the specific secret that we're referencing."
type: "string"
SecretName:
description: |
SecretName is the name of the secret that this references, but this is just provided for
lookup/display purposes. The secret in the reference will be identified by its ID.
type: "string"
Configs:
description: "Configs contains references to zero or more configs that will be exposed to the service."
type: "array"
items:
type: "object"
properties:
File:
description: "File represents a specific target that is backed by a file."
type: "object"
properties:
Name:
description: "Name represents the final filename in the filesystem."
type: "string"
UID:
description: "UID represents the file UID."
type: "string"
GID:
description: "GID represents the file GID."
type: "string"
Mode:
description: "Mode represents the FileMode of the file."
type: "integer"
format: "uint32"
ConfigID:
description: "ConfigID represents the ID of the specific config that we're referencing."
type: "string"
ConfigName:
description: |
ConfigName is the name of the config that this references, but this is just provided for
lookup/display purposes. The config in the reference will be identified by its ID.
type: "string"
Resources:
description: "Resource requirements which apply to each individual container created as part of the service."
type: "object"
properties:
Limits:
description: "Define resources limits."
type: "object"
properties:
NanoCPUs:
description: "CPU limit in units of 10<sup>-9</sup> CPU shares."
type: "integer"
format: "int64"
MemoryBytes:
description: "Memory limit in Bytes."
type: "integer"
format: "int64"
Reservation:
description: "Define resources reservation."
properties:
NanoCPUs:
description: "CPU reservation in units of 10<sup>-9</sup> CPU shares."
type: "integer"
format: "int64"
MemoryBytes:
description: "Memory reservation in Bytes."
type: "integer"
format: "int64"
RestartPolicy:
description: "Specification for the restart policy which applies to containers created as part of this service."
type: "object"
properties:
Condition:
description: "Condition for restart."
type: "string"
enum:
- "none"
- "on-failure"
- "any"
Delay:
description: "Delay between restart attempts."
type: "integer"
format: "int64"
MaxAttempts:
description: "Maximum attempts to restart a given container before giving up (default value is 0, which is ignored)."
type: "integer"
format: "int64"
default: 0
Window:
description: "Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded)."
type: "integer"
format: "int64"
default: 0
Placement:
type: "object"
properties:
Constraints:
description: "An array of constraints."
type: "array"
items:
type: "string"
Preferences:
description: "Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence."
type: "array"
items:
type: "object"
properties:
Spread:
type: "object"
properties:
SpreadDescriptor:
description: "label descriptor, such as engine.labels.az"
type: "string"
Platforms:
description: "An array of supported platforms."
type: "array"
items:
type: "object"
properties:
Architecture:
type: "string"
OS:
type: "string"
ForceUpdate:
description: "A counter that triggers an update even if no relevant parameters have been changed."
type: "integer"
Runtime:
description: "Runtime is the type of runtime specified for the task executor."
type: "string"
Networks:
type: "array"
items:
type: "object"
properties:
Target:
type: "string"
Aliases:
type: "array"
items:
type: "string"
LogDriver:
description: "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."
type: "object"
properties:
Name:
type: "string"
Options:
type: "object"
additionalProperties:
type: "string"
TaskState:
type: "string"
enum:
- "new"
- "allocated"
- "pending"
- "assigned"
- "accepted"
- "preparing"
- "ready"
- "starting"
- "running"
- "complete"
- "shutdown"
- "failed"
- "rejected"
Task:
type: "object"
properties:
ID:
description: "The ID of the task."
type: "string"
Version:
$ref: "#/definitions/ObjectVersion"
CreatedAt:
type: "string"
format: "dateTime"
UpdatedAt:
type: "string"
format: "dateTime"
Name:
description: "Name of the task."
type: "string"
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
Spec:
$ref: "#/definitions/TaskSpec"
ServiceID:
description: "The ID of the service this task is part of."
type: "string"
Slot:
type: "integer"
NodeID:
description: "The ID of the node that this task is on."
type: "string"
Status:
type: "object"
properties:
Timestamp:
type: "string"
format: "dateTime"
State:
$ref: "#/definitions/TaskState"
Message:
type: "string"
Err:
type: "string"
ContainerStatus:
type: "object"
properties:
ContainerID:
type: "string"
PID:
type: "integer"
ExitCode:
type: "integer"
DesiredState:
$ref: "#/definitions/TaskState"
example:
ID: "0kzzo1i0y4jz6027t0k7aezc7"
Version:
Index: 71
CreatedAt: "2016-06-07T21:07:31.171892745Z"
UpdatedAt: "2016-06-07T21:07:31.376370513Z"
Spec:
ContainerSpec:
Image: "redis"
Resources:
Limits: {}
Reservations: {}
RestartPolicy:
Condition: "any"
MaxAttempts: 0
Placement: {}
ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz"
Slot: 1
NodeID: "60gvrl6tm78dmak4yl7srz94v"
Status:
Timestamp: "2016-06-07T21:07:31.290032978Z"
State: "running"
Message: "started"
ContainerStatus:
ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035"
PID: 677
DesiredState: "running"
NetworksAttachments:
- Network:
ID: "4qvuz4ko70xaltuqbt8956gd1"
Version:
Index: 18
CreatedAt: "2016-06-07T20:31:11.912919752Z"
UpdatedAt: "2016-06-07T21:07:29.955277358Z"
Spec:
Name: "ingress"
Labels:
com.docker.swarm.internal: "true"
DriverConfiguration: {}
IPAMOptions:
Driver: {}
Configs:
- Subnet: "10.255.0.0/16"
Gateway: "10.255.0.1"
DriverState:
Name: "overlay"
Options:
com.docker.network.driver.overlay.vxlanid_list: "256"
IPAMOptions:
Driver:
Name: "default"
Configs:
- Subnet: "10.255.0.0/16"
Gateway: "10.255.0.1"
Addresses:
- "10.255.0.10/16"
ServiceSpec:
description: "User modifiable configuration for a service."
properties:
Name:
description: "Name of the service."
type: "string"
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
TaskTemplate:
$ref: "#/definitions/TaskSpec"
Mode:
description: "Scheduling mode for the service."
type: "object"
properties:
Replicated:
type: "object"
properties:
Replicas:
type: "integer"
format: "int64"
Global:
type: "object"
UpdateConfig:
description: "Specification for the update strategy of the service."
type: "object"
properties:
Parallelism:
description: "Maximum number of tasks to be updated in one iteration (0 means unlimited parallelism)."
type: "integer"
format: "int64"
Delay:
description: "Amount of time between updates, in nanoseconds."
type: "integer"
format: "int64"
FailureAction:
description: "Action to take if an updated task fails to run, or stops running during the update."
type: "string"
enum:
- "continue"
- "pause"
- "rollback"
Monitor:
description: "Amount of time to monitor each updated task for failures, in nanoseconds."
type: "integer"
format: "int64"
MaxFailureRatio:
description: "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."
type: "number"
default: 0
Order:
description: "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."
type: "string"
enum:
- "stop-first"
- "start-first"
RollbackConfig:
description: "Specification for the rollback strategy of the service."
type: "object"
properties:
Parallelism:
description: "Maximum number of tasks to be rolled back in one iteration (0 means unlimited parallelism)."
type: "integer"
format: "int64"
Delay:
description: "Amount of time between rollback iterations, in nanoseconds."
type: "integer"
format: "int64"
FailureAction:
description: "Action to take if an rolled back task fails to run, or stops running during the rollback."
type: "string"
enum:
- "continue"
- "pause"
Monitor:
description: "Amount of time to monitor each rolled back task for failures, in nanoseconds."
type: "integer"
format: "int64"
MaxFailureRatio:
description: "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."
type: "number"
default: 0
Order:
description: "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."
type: "string"
enum:
- "stop-first"
- "start-first"
Networks:
description: "Array of network names or IDs to attach the service to."
type: "array"
items:
type: "object"
properties:
Target:
type: "string"
Aliases:
type: "array"
items:
type: "string"
EndpointSpec:
$ref: "#/definitions/EndpointSpec"
EndpointPortConfig:
type: "object"
properties:
Name:
type: "string"
Protocol:
type: "string"
enum:
- "tcp"
- "udp"
TargetPort:
description: "The port inside the container."
type: "integer"
PublishedPort:
description: "The port on the swarm hosts."
type: "integer"
EndpointSpec:
description: "Properties that can be configured to access and load balance a service."
type: "object"
properties:
Mode:
description: "The mode of resolution to use for internal load balancing
between tasks."
type: "string"
enum:
- "vip"
- "dnsrr"
default: "vip"
Ports:
description: "List of exposed ports that this service is accessible on from the outside. Ports can only be provided if `vip` resolution mode is used."
type: "array"
items:
$ref: "#/definitions/EndpointPortConfig"
Service:
type: "object"
properties:
ID:
type: "string"
Version:
$ref: "#/definitions/ObjectVersion"
CreatedAt:
type: "string"
format: "dateTime"
UpdatedAt:
type: "string"
format: "dateTime"
Spec:
$ref: "#/definitions/ServiceSpec"
Endpoint:
type: "object"
properties:
Spec:
$ref: "#/definitions/EndpointSpec"
Ports:
type: "array"
items:
$ref: "#/definitions/EndpointPortConfig"
VirtualIPs:
type: "array"
items:
type: "object"
properties:
NetworkID:
type: "string"
Addr:
type: "string"
UpdateStatus:
description: "The status of a service update."
type: "object"
properties:
State:
type: "string"
enum:
- "updating"
- "paused"
- "completed"
StartedAt:
type: "string"
format: "dateTime"
CompletedAt:
type: "string"
format: "dateTime"
Message:
type: "string"
example:
ID: "9mnpnzenvg8p8tdbtq4wvbkcz"
Version:
Index: 19
CreatedAt: "2016-06-07T21:05:51.880065305Z"
UpdatedAt: "2016-06-07T21:07:29.962229872Z"
Spec:
Name: "hopeful_cori"
TaskTemplate:
ContainerSpec:
Image: "redis"
Resources:
Limits: {}
Reservations: {}
RestartPolicy:
Condition: "any"
MaxAttempts: 0
Placement: {}
ForceUpdate: 0
Mode:
Replicated:
Replicas: 1
UpdateConfig:
Parallelism: 1
Delay: 1000000000
FailureAction: "pause"
Monitor: 15000000000
MaxFailureRatio: 0.15
RollbackConfig:
Parallelism: 1
Delay: 1000000000
FailureAction: "pause"
Monitor: 15000000000
MaxFailureRatio: 0.15
EndpointSpec:
Mode: "vip"
Ports:
-
Protocol: "tcp"
TargetPort: 6379
PublishedPort: 30001
Endpoint:
Spec:
Mode: "vip"
Ports:
-
Protocol: "tcp"
TargetPort: 6379
PublishedPort: 30001
Ports:
-
Protocol: "tcp"
TargetPort: 6379
PublishedPort: 30001
VirtualIPs:
-
NetworkID: "4qvuz4ko70xaltuqbt8956gd1"
Addr: "10.255.0.2/16"
-
NetworkID: "4qvuz4ko70xaltuqbt8956gd1"
Addr: "10.255.0.3/16"
ImageDeleteResponseItem:
type: "object"
properties:
Untagged:
description: "The image ID of an image that was untagged"
type: "string"
Deleted:
description: "The image ID of an image that was deleted"
type: "string"
ServiceUpdateResponse:
type: "object"
properties:
Warnings:
description: "Optional warning messages"
type: "array"
items:
type: "string"
example:
Warning: "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found"
ContainerSummary:
type: "array"
items:
type: "object"
properties:
Id:
description: "The ID of this container"
type: "string"
x-go-name: "ID"
Names:
description: "The names that this container has been given"
type: "array"
items:
type: "string"
Image:
description: "The name of the image used when creating this container"
type: "string"
ImageID:
description: "The ID of the image that this container was created from"
type: "string"
Command:
description: "Command to run when starting the container"
type: "string"
Created:
description: "When the container was created"
type: "integer"
format: "int64"
Ports:
description: "The ports exposed by this container"
type: "array"
items:
$ref: "#/definitions/Port"
SizeRw:
description: "The size of files that have been created or changed by this container"
type: "integer"
format: "int64"
SizeRootFs:
description: "The total size of all the files in this container"
type: "integer"
format: "int64"
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
State:
description: "The state of this container (e.g. `Exited`)"
type: "string"
Status:
description: "Additional human-readable status of this container (e.g. `Exit 0`)"
type: "string"
HostConfig:
type: "object"
properties:
NetworkMode:
type: "string"
NetworkSettings:
description: "A summary of the container's network settings"
type: "object"
properties:
Networks:
type: "object"
additionalProperties:
$ref: "#/definitions/EndpointSettings"
Mounts:
type: "array"
items:
$ref: "#/definitions/Mount"
SecretSpec:
type: "object"
properties:
Name:
description: "User-defined name of the secret."
type: "string"
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
Data:
description: "Base64-url-safe-encoded secret data"
type: "array"
items:
type: "string"
Secret:
type: "object"
properties:
ID:
type: "string"
Version:
$ref: "#/definitions/ObjectVersion"
CreatedAt:
type: "string"
format: "dateTime"
UpdatedAt:
type: "string"
format: "dateTime"
Spec:
$ref: "#/definitions/SecretSpec"
ConfigSpec:
type: "object"
properties:
Name:
description: "User-defined name of the config."
type: "string"
Labels:
description: "User-defined key/value metadata."
type: "object"
additionalProperties:
type: "string"
Data:
description: "Base64-url-safe-encoded config data"
type: "array"
items:
type: "string"
Config:
type: "object"
properties:
ID:
type: "string"
Version:
$ref: "#/definitions/ObjectVersion"
CreatedAt:
type: "string"
format: "dateTime"
UpdatedAt:
type: "string"
format: "dateTime"
Spec:
$ref: "#/definitions/ConfigSpec"
paths:
/containers/json:
get:
summary: "List containers"
operationId: "ContainerList"
produces:
- "application/json"
parameters:
- name: "all"
in: "query"
description: "Return all containers. By default, only running containers are shown"
type: "boolean"
default: false
- name: "limit"
in: "query"
description: "Return this number of most recently created containers, including non-running ones."
type: "integer"
- name: "size"
in: "query"
description: "Return the size of container as fields `SizeRw` and `SizeRootFs`."
type: "boolean"
default: false
- name: "filters"
in: "query"
description: |
Filters to process on the container list, encoded as JSON (a `map[string][]string`). For example, `{"status": ["paused"]}` will only return paused containers. Available filters:
- `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`)
- `before`=(`<container id>` or `<container name>`)
- `expose`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`)
- `exited=<int>` containers with exit code of `<int>`
- `health`=(`starting`|`healthy`|`unhealthy`|`none`)
- `id=<ID>` a container's ID
- `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only)
- `is-task=`(`true`|`false`)
- `label=key` or `label="key=value"` of a container label
- `name=<name>` a container's name
- `network`=(`<network id>` or `<network name>`)
- `publish`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`)
- `since`=(`<container id>` or `<container name>`)
- `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`)
- `volume`=(`<volume name>` or `<mount point destination>`)
type: "string"
responses:
200:
description: "no error"
schema:
$ref: "#/definitions/ContainerSummary"
examples:
application/json:
- Id: "8dfafdbc3a40"
Names:
- "/boring_feynman"
Image: "ubuntu:latest"
ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82"
Command: "echo 1"
Created: 1367854155
State: "Exited"
Status: "Exit 0"
Ports:
- PrivatePort: 2222
PublicPort: 3333
Type: "tcp"
Labels:
com.example.vendor: "Acme"
com.example.license: "GPL"
com.example.version: "1.0"
SizeRw: 12288
SizeRootFs: 0
HostConfig:
NetworkMode: "default"
NetworkSettings:
Networks:
bridge:
NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812"
EndpointID: "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f"
Gateway: "172.17.0.1"
IPAddress: "172.17.0.2"
IPPrefixLen: 16
IPv6Gateway: ""
GlobalIPv6Address: ""
GlobalIPv6PrefixLen: 0
MacAddress: "02:42:ac:11:00:02"
Mounts:
- Name: "fac362...80535"
Source: "/data"
Destination: "/data"
Driver: "local"
Mode: "ro,Z"
RW: false
Propagation: ""
- Id: "9cd87474be90"
Names:
- "/coolName"
Image: "ubuntu:latest"
ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82"
Command: "echo 222222"
Created: 1367854155
State: "Exited"
Status: "Exit 0"
Ports: []
Labels: {}
SizeRw: 12288
SizeRootFs: 0
HostConfig:
NetworkMode: "default"
NetworkSettings:
Networks:
bridge:
NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812"
EndpointID: "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a"
Gateway: "172.17.0.1"
IPAddress: "172.17.0.8"
IPPrefixLen: 16
IPv6Gateway: ""
GlobalIPv6Address: ""
GlobalIPv6PrefixLen: 0
MacAddress: "02:42:ac:11:00:08"
Mounts: []
- Id: "3176a2479c92"
Names:
- "/sleepy_dog"
Image: "ubuntu:latest"
ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82"
Command: "echo 3333333333333333"
Created: 1367854154
State: "Exited"
Status: "Exit 0"
Ports: []
Labels: {}
SizeRw: 12288
SizeRootFs: 0
HostConfig:
NetworkMode: "default"
NetworkSettings:
Networks:
bridge:
NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812"
EndpointID: "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d"
Gateway: "172.17.0.1"
IPAddress: "172.17.0.6"
IPPrefixLen: 16
IPv6Gateway: ""
GlobalIPv6Address: ""
GlobalIPv6PrefixLen: 0
MacAddress: "02:42:ac:11:00:06"
Mounts: []
- Id: "4cb07b47f9fb"
Names:
- "/running_cat"
Image: "ubuntu:latest"
ImageID: "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82"
Command: "echo 444444444444444444444444444444444"
Created: 1367854152
State: "Exited"
Status: "Exit 0"
Ports: []
Labels: {}
SizeRw: 12288
SizeRootFs: 0
HostConfig:
NetworkMode: "default"
NetworkSettings:
Networks:
bridge:
NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812"
EndpointID: "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9"
Gateway: "172.17.0.1"
IPAddress: "172.17.0.5"
IPPrefixLen: 16
IPv6Gateway: ""
GlobalIPv6Address: ""
GlobalIPv6PrefixLen: 0
MacAddress: "02:42:ac:11:00:05"
Mounts: []
400:
description: "bad parameter"
schema:
$ref: "#/definitions/ErrorResponse"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
tags: ["Container"]
/containers/create:
post:
summary: "Create a container"
operationId: "ContainerCreate"
consumes:
- "application/json"
- "application/octet-stream"
produces:
- "application/json"
parameters:
- name: "name"
in: "query"
description: "Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`."
type: "string"
pattern: "/?[a-zA-Z0-9_-]+"
- name: "body"
in: "body"
description: "Container to create"
schema:
allOf:
- $ref: "#/definitions/ContainerConfig"
- type: "object"
properties:
HostConfig:
$ref: "#/definitions/HostConfig"
NetworkingConfig:
description: "This container's networking configuration."
type: "object"
properties:
EndpointsConfig:
description: "A mapping of network name to endpoint configuration for that network."
type: "object"
additionalProperties:
$ref: "#/definitions/EndpointSettings"
example:
Hostname: ""
Domainname: ""
User: ""
AttachStdin: false
AttachStdout: true
AttachStderr: true
Tty: false
OpenStdin: false
StdinOnce: false
Env:
- "FOO=bar"
- "BAZ=quux"
Cmd:
- "date"
Entrypoint: ""
Image: "ubuntu"
Labels:
com.example.vendor: "Acme"
com.example.license: "GPL"
com.example.version: "1.0"
Volumes:
/volumes/data: {}
WorkingDir: ""
NetworkDisabled: false
MacAddress: "12:34:56:78:9a:bc"
ExposedPorts:
22/tcp: {}
StopSignal: "SIGTERM"
StopTimeout: 10
HostConfig:
Binds:
- "/tmp:/tmp"
Links:
- "redis3:redis"
Memory: 0
MemorySwap: 0
MemoryReservation: 0
KernelMemory: 0
NanoCPUs: 500000
CpuPercent: 80
CpuShares: 512
CpuPeriod: 100000
CpuRealtimePeriod: 1000000
CpuRealtimeRuntime: 10000
CpuQuota: 50000
CpusetCpus: "0,1"
CpusetMems: "0,1"
MaximumIOps: 0
MaximumIOBps: 0
BlkioWeight: 300
BlkioWeightDevice:
- {}
BlkioDeviceReadBps:
- {}
BlkioDeviceReadIOps:
- {}
BlkioDeviceWriteBps:
- {}
BlkioDeviceWriteIOps:
- {}
MemorySwappiness: 60
OomKillDisable: false
OomScoreAdj: 500
PidMode: ""
PidsLimit: -1
PortBindings:
22/tcp:
- HostPort: "11022"
PublishAllPorts: false
Privileged: false
ReadonlyRootfs: false
Dns:
- "8.8.8.8"
DnsOptions:
- ""
DnsSearch:
- ""
VolumesFrom:
- "parent"
- "other:ro"
CapAdd:
- "NET_ADMIN"
CapDrop:
- "MKNOD"
GroupAdd:
- "newgroup"
RestartPolicy:
Name: ""
MaximumRetryCount: 0
AutoRemove: true
NetworkMode: "bridge"
Devices: []
Ulimits:
- {}
LogConfig:
Type: "json-file"
Config: {}
SecurityOpt: []
StorageOpt: {}
CgroupParent: ""
VolumeDriver: ""
ShmSize: 67108864
NetworkingConfig:
EndpointsConfig:
isolated_nw:
IPAMConfig:
IPv4Address: "172.20.30.33"
IPv6Address: "2001:db8:abcd::3033"
LinkLocalIPs:
- "169.254.34.68"
- "fe80::3468"
Links:
- "container_1"
- "container_2"
Aliases:
- "server_x"
- "server_y"
required: true
responses:
201:
description: "Container created successfully"
schema:
type: "object"
required: [Id, Warnings]
properties:
Id:
description: "The ID of the created container"
type: "string"
x-nullable: false
Warnings:
description: "Warnings encountered when creating the container"
type: "array"
x-nullable: false
items:
type: "string"
examples:
application/json:
Id: "e90e34656806"
Warnings: []
400:
description: "bad parameter"
schema:
$ref: "#/definitions/ErrorResponse"
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
406:
description: "impossible to attach"
schema:
$ref: "#/definitions/ErrorResponse"
409:
description: "conflict"
schema:
$ref: "#/definitions/ErrorResponse"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
tags: ["Container"]
/containers/{id}/json:
get:
summary: "Inspect a container"
description: "Return low-level information about a container."
operationId: "ContainerInspect"
produces:
- "application/json"
responses:
200:
description: "no error"
schema:
type: "object"
properties:
Id:
description: "The ID of the container"
type: "string"
Created:
description: "The time the container was created"
type: "string"
Path:
description: "The path to the command being run"
type: "string"
Args:
description: "The arguments to the command being run"
type: "array"
items:
type: "string"
State:
description: "The state of the container."
type: "object"
properties:
Status:
description: |
The status of the container. For example, `"running"` or `"exited"`.
type: "string"
enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"]
Running:
description: |
Whether this container is running.
Note that a running container can be _paused_. The `Running` and `Paused`
booleans are not mutually exclusive:
When pausing a container (on Linux), the cgroups freezer is used to suspend
all processes in the container. Freezing the process requires the process to
be running. As a result, paused containers are both `Running` _and_ `Paused`.
Use the `Status` field instead to determine if a container's state is "running".
type: "boolean"
Paused:
description: "Whether this container is paused."
type: "boolean"
Restarting:
description: "Whether this container is restarting."
type: "boolean"
OOMKilled:
description: "Whether this container has been killed because it ran out of memory."
type: "boolean"
Dead:
type: "boolean"
Pid:
description: "The process ID of this container"
type: "integer"
ExitCode:
description: "The last exit code of this container"
type: "integer"
Error:
type: "string"
StartedAt:
description: "The time when this container was last started."
type: "string"
FinishedAt:
description: "The time when this container last exited."
type: "string"
Image:
description: "The container's image"
type: "string"
ResolvConfPath:
type: "string"
HostnamePath:
type: "string"
HostsPath:
type: "string"
LogPath:
type: "string"
Node:
description: "TODO"
type: "object"
Name:
type: "string"
RestartCount:
type: "integer"
Driver:
type: "string"
MountLabel:
type: "string"
ProcessLabel:
type: "string"
AppArmorProfile:
type: "string"
ExecIDs:
type: "string"
HostConfig:
$ref: "#/definitions/HostConfig"
GraphDriver:
$ref: "#/definitions/GraphDriverData"
SizeRw:
description: "The size of files that have been created or changed by this container."
type: "integer"
format: "int64"
SizeRootFs:
description: "The total size of all the files in this container."
type: "integer"
format: "int64"
Mounts:
type: "array"
items:
$ref: "#/definitions/MountPoint"
Config:
$ref: "#/definitions/ContainerConfig"
NetworkSettings:
$ref: "#/definitions/NetworkConfig"
examples:
application/json:
AppArmorProfile: ""
Args:
- "-c"
- "exit 9"
Config:
AttachStderr: true
AttachStdin: false
AttachStdout: true
Cmd:
- "/bin/sh"
- "-c"
- "exit 9"
Domainname: ""
Env:
- "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Hostname: "ba033ac44011"
Image: "ubuntu"
Labels:
com.example.vendor: "Acme"
com.example.license: "GPL"
com.example.version: "1.0"
MacAddress: ""
NetworkDisabled: false
OpenStdin: false
StdinOnce: false
Tty: false
User: ""
Volumes:
/volumes/data: {}
WorkingDir: ""
StopSignal: "SIGTERM"
StopTimeout: 10
Created: "2015-01-06T15:47:31.485331387Z"
Driver: "devicemapper"
HostConfig:
MaximumIOps: 0
MaximumIOBps: 0
BlkioWeight: 0
BlkioWeightDevice:
- {}
BlkioDeviceReadBps:
- {}
BlkioDeviceWriteBps:
- {}
BlkioDeviceReadIOps:
- {}
BlkioDeviceWriteIOps:
- {}
ContainerIDFile: ""
CpusetCpus: ""
CpusetMems: ""
CpuPercent: 80
CpuShares: 0
CpuPeriod: 100000
CpuRealtimePeriod: 1000000
CpuRealtimeRuntime: 10000
Devices: []
IpcMode: ""
LxcConf: []
Memory: 0
MemorySwap: 0
MemoryReservation: 0
KernelMemory: 0
OomKillDisable: false
OomScoreAdj: 500
NetworkMode: "bridge"
PidMode: ""
PortBindings: {}
Privileged: false
ReadonlyRootfs: false
PublishAllPorts: false
RestartPolicy:
MaximumRetryCount: 2
Name: "on-failure"
LogConfig:
Type: "json-file"
Sysctls:
net.ipv4.ip_forward: "1"
Ulimits:
- {}
VolumeDriver: ""
ShmSize: 67108864
HostnamePath: "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname"
HostsPath: "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts"
LogPath: "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log"
Id: "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39"
Image: "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2"
MountLabel: ""
Name: "/boring_euclid"
NetworkSettings:
Bridge: ""
SandboxID: ""
HairpinMode: false
LinkLocalIPv6Address: ""
LinkLocalIPv6PrefixLen: 0
SandboxKey: ""
SecondaryIPAddresses: null
SecondaryIPv6Addresses: null
EndpointID: ""
Gateway: ""
GlobalIPv6Address: ""
GlobalIPv6PrefixLen: 0
IPAddress: ""
IPPrefixLen: 0
IPv6Gateway: ""
MacAddress: ""
Networks:
bridge:
NetworkID: "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812"
EndpointID: "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d"
Gateway: "172.17.0.1"
IPAddress: "172.17.0.2"
IPPrefixLen: 16
IPv6Gateway: ""
GlobalIPv6Address: ""
GlobalIPv6PrefixLen: 0
MacAddress: "02:42:ac:12:00:02"
Path: "/bin/sh"
ProcessLabel: ""
ResolvConfPath: "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf"
RestartCount: 1
State:
Error: ""
ExitCode: 9
FinishedAt: "2015-01-06T15:47:32.080254511Z"
OOMKilled: false
Dead: false
Paused: false
Pid: 0
Restarting: false
Running: true
StartedAt: "2015-01-06T15:47:32.072697474Z"
Status: "running"
Mounts:
- Name: "fac362...80535"
Source: "/data"
Destination: "/data"
Driver: "local"
Mode: "ro,Z"
RW: false
Propagation: ""
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
- name: "size"
in: "query"
type: "boolean"
default: false
description: "Return the size of container as fields `SizeRw` and `SizeRootFs`"
tags: ["Container"]
/containers/{id}/top:
get:
summary: "List processes running inside a container"
description: "On Unix systems, this is done by running the `ps` command. This endpoint is not supported on Windows."
operationId: "ContainerTop"
responses:
200:
description: "no error"
schema:
type: "object"
properties:
Titles:
description: "The ps column titles"
type: "array"
items:
type: "string"
Processes:
description: "Each process running in the container, where each is process is an array of values corresponding to the titles"
type: "array"
items:
type: "array"
items:
type: "string"
examples:
application/json:
Titles:
- "UID"
- "PID"
- "PPID"
- "C"
- "STIME"
- "TTY"
- "TIME"
- "CMD"
Processes:
-
- "root"
- "13642"
- "882"
- "0"
- "17:03"
- "pts/0"
- "00:00:00"
- "/bin/bash"
-
- "root"
- "13735"
- "13642"
- "0"
- "17:06"
- "pts/0"
- "00:00:00"
- "sleep 10"
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
- name: "ps_args"
in: "query"
description: "The arguments to pass to `ps`. For example, `aux`"
type: "string"
default: "-ef"
tags: ["Container"]
/containers/{id}/logs:
get:
summary: "Get container logs"
description: |
Get `stdout` and `stderr` logs from a container.
Note: This endpoint works only for containers with the `json-file` or `journald` logging driver.
operationId: "ContainerLogs"
responses:
101:
description: "logs returned as a stream"
schema:
type: "string"
format: "binary"
200:
description: "logs returned as a string in response body"
schema:
type: "string"
404:
description: "no such container"
schema:
$ref: "#/definitions/ErrorResponse"
examples:
application/json:
message: "No such container: c2ada9df5af8"
500:
description: "server error"
schema:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
- name: "follow"
in: "query"
description: |
Return the logs as a stream.
This will return a `101` HTTP response with a `Connection: upgrade` header, then hijack the HTTP connection to send raw output. For more information about hijacking and the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach).
type: "boolean"
default: false
- name: "stdout"
in: "query"