mirror of https://github.com/docker/docs.git
docs: update API for features added in 1.11
Docker 1.11 added a feature to set labels on volumes, networks and images (during build), but these changes were not documented in the API documentation. This adds the new features to the documentation. Also fixes some minor formatting, and options that were not used in the examples. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
7bfa122472
commit
ba353f3787
|
|
@ -1678,6 +1678,7 @@ Query Parameters:
|
||||||
variable expansion in other Dockerfile instructions. This is not meant for
|
variable expansion in other Dockerfile instructions. This is not meant for
|
||||||
passing secret values. [Read more about the buildargs instruction](../../reference/builder.md#arg)
|
passing secret values. [Read more about the buildargs instruction](../../reference/builder.md#arg)
|
||||||
- **shmsize** - Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.
|
- **shmsize** - Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.
|
||||||
|
- **labels** – JSON map of string pairs for labels to set on the image.
|
||||||
|
|
||||||
Request Headers:
|
Request Headers:
|
||||||
|
|
||||||
|
|
@ -2639,7 +2640,7 @@ interactive session with the `exec` command.
|
||||||
**Example response**:
|
**Example response**:
|
||||||
|
|
||||||
HTTP/1.1 200 OK
|
HTTP/1.1 200 OK
|
||||||
Content-Type: vnd.docker.raw-stream
|
Content-Type: application/vnd.docker.raw-stream
|
||||||
|
|
||||||
{{ STREAM }}
|
{{ STREAM }}
|
||||||
|
|
||||||
|
|
@ -2774,7 +2775,11 @@ Create a volume
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
"Name": "tardis"
|
"Name": "tardis",
|
||||||
|
"Labels": {
|
||||||
|
"com.example.some-label": "some-value",
|
||||||
|
"com.example.some-other-label": "some-other-value"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
**Example response**:
|
**Example response**:
|
||||||
|
|
@ -2785,7 +2790,11 @@ Create a volume
|
||||||
{
|
{
|
||||||
"Name": "tardis",
|
"Name": "tardis",
|
||||||
"Driver": "local",
|
"Driver": "local",
|
||||||
"Mountpoint": "/var/lib/docker/volumes/tardis"
|
"Mountpoint": "/var/lib/docker/volumes/tardis",
|
||||||
|
"Labels": {
|
||||||
|
"com.example.some-label": "some-value",
|
||||||
|
"com.example.some-other-label": "some-other-value"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
Status Codes:
|
Status Codes:
|
||||||
|
|
@ -2799,6 +2808,7 @@ JSON Parameters:
|
||||||
- **Driver** - Name of the volume driver to use. Defaults to `local` for the name.
|
- **Driver** - Name of the volume driver to use. Defaults to `local` for the name.
|
||||||
- **DriverOpts** - A mapping of driver options and values. These options are
|
- **DriverOpts** - A mapping of driver options and values. These options are
|
||||||
passed directly to the driver and are driver specific.
|
passed directly to the driver and are driver specific.
|
||||||
|
- **Labels** - Labels to set on the volume, specified as a map: `{"key":"value" [,"key2":"value2"]}`
|
||||||
|
|
||||||
### Inspect a volume
|
### Inspect a volume
|
||||||
|
|
||||||
|
|
@ -2818,7 +2828,11 @@ Return low-level information on the volume `name`
|
||||||
{
|
{
|
||||||
"Name": "tardis",
|
"Name": "tardis",
|
||||||
"Driver": "local",
|
"Driver": "local",
|
||||||
"Mountpoint": "/var/lib/docker/volumes/tardis"
|
"Mountpoint": "/var/lib/docker/volumes/tardis/_data",
|
||||||
|
"Labels": {
|
||||||
|
"com.example.some-label": "some-value",
|
||||||
|
"com.example.some-other-label": "some-other-value"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Status Codes:
|
Status Codes:
|
||||||
|
|
@ -2989,6 +3003,10 @@ Content-Type: application/json
|
||||||
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
|
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
|
||||||
"com.docker.network.bridge.name": "docker0",
|
"com.docker.network.bridge.name": "docker0",
|
||||||
"com.docker.network.driver.mtu": "1500"
|
"com.docker.network.driver.mtu": "1500"
|
||||||
|
},
|
||||||
|
"Labels": {
|
||||||
|
"com.example.some-label": "some-value",
|
||||||
|
"com.example.some-other-label": "some-other-value"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
@ -3012,6 +3030,7 @@ Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
"Name":"isolated_nw",
|
"Name":"isolated_nw",
|
||||||
|
"CheckDuplicate":false,
|
||||||
"Driver":"bridge",
|
"Driver":"bridge",
|
||||||
"EnableIPv6": true,
|
"EnableIPv6": true,
|
||||||
"IPAM":{
|
"IPAM":{
|
||||||
|
|
@ -3030,7 +3049,19 @@ Content-Type: application/json
|
||||||
"foo": "bar"
|
"foo": "bar"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Internal":true
|
"Internal":true,
|
||||||
|
"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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -3055,12 +3086,13 @@ Status Codes:
|
||||||
JSON Parameters:
|
JSON Parameters:
|
||||||
|
|
||||||
- **Name** - The new network's name. this is a mandatory field
|
- **Name** - The new network's name. this is a mandatory field
|
||||||
|
- **CheckDuplicate** - Requests daemon to check for networks with same name
|
||||||
- **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver
|
- **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver
|
||||||
- **Internal** - Restrict external access to the network
|
- **Internal** - Restrict external access to the network
|
||||||
- **IPAM** - Optional custom IP scheme for the network
|
- **IPAM** - Optional custom IP scheme for the network
|
||||||
- **EnableIPv6** - Enable IPv6 on the network
|
- **EnableIPv6** - Enable IPv6 on the network
|
||||||
- **Options** - Network specific options to be used by the drivers
|
- **Options** - Network specific options to be used by the drivers
|
||||||
- **CheckDuplicate** - Requests daemon to check for networks with same name
|
- **Labels** - Labels to set on the network, specified as a map: `{"key":"value" [,"key2":"value2"]}`
|
||||||
|
|
||||||
### Connect a container to a network
|
### Connect a container to a network
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1685,6 +1685,7 @@ Query Parameters:
|
||||||
variable expansion in other Dockerfile instructions. This is not meant for
|
variable expansion in other Dockerfile instructions. This is not meant for
|
||||||
passing secret values. [Read more about the buildargs instruction](../../reference/builder.md#arg)
|
passing secret values. [Read more about the buildargs instruction](../../reference/builder.md#arg)
|
||||||
- **shmsize** - Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.
|
- **shmsize** - Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB.
|
||||||
|
- **labels** – JSON map of string pairs for labels to set on the image.
|
||||||
|
|
||||||
Request Headers:
|
Request Headers:
|
||||||
|
|
||||||
|
|
@ -2789,7 +2790,11 @@ Create a volume
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
"Name": "tardis"
|
"Name": "tardis",
|
||||||
|
"Labels": {
|
||||||
|
"com.example.some-label": "some-value",
|
||||||
|
"com.example.some-other-label": "some-other-value"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
**Example response**:
|
**Example response**:
|
||||||
|
|
@ -2801,7 +2806,11 @@ Create a volume
|
||||||
"Name": "tardis",
|
"Name": "tardis",
|
||||||
"Driver": "local",
|
"Driver": "local",
|
||||||
"Mountpoint": "/var/lib/docker/volumes/tardis",
|
"Mountpoint": "/var/lib/docker/volumes/tardis",
|
||||||
"Status": null
|
"Status": null,
|
||||||
|
"Labels": {
|
||||||
|
"com.example.some-label": "some-value",
|
||||||
|
"com.example.some-other-label": "some-other-value"
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
Status Codes:
|
Status Codes:
|
||||||
|
|
@ -2815,6 +2824,7 @@ JSON Parameters:
|
||||||
- **Driver** - Name of the volume driver to use. Defaults to `local` for the name.
|
- **Driver** - Name of the volume driver to use. Defaults to `local` for the name.
|
||||||
- **DriverOpts** - A mapping of driver options and values. These options are
|
- **DriverOpts** - A mapping of driver options and values. These options are
|
||||||
passed directly to the driver and are driver specific.
|
passed directly to the driver and are driver specific.
|
||||||
|
- **Labels** - Labels to set on the volume, specified as a map: `{"key":"value" [,"key2":"value2"]}`
|
||||||
|
|
||||||
### Inspect a volume
|
### Inspect a volume
|
||||||
|
|
||||||
|
|
@ -2834,7 +2844,11 @@ Return low-level information on the volume `name`
|
||||||
{
|
{
|
||||||
"Name": "tardis",
|
"Name": "tardis",
|
||||||
"Driver": "local",
|
"Driver": "local",
|
||||||
"Mountpoint": "/var/lib/docker/volumes/tardis"
|
"Mountpoint": "/var/lib/docker/volumes/tardis/_data",
|
||||||
|
"Labels": {
|
||||||
|
"com.example.some-label": "some-value",
|
||||||
|
"com.example.some-other-label": "some-other-value"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Status Codes:
|
Status Codes:
|
||||||
|
|
@ -3005,6 +3019,10 @@ Content-Type: application/json
|
||||||
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
|
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
|
||||||
"com.docker.network.bridge.name": "docker0",
|
"com.docker.network.bridge.name": "docker0",
|
||||||
"com.docker.network.driver.mtu": "1500"
|
"com.docker.network.driver.mtu": "1500"
|
||||||
|
},
|
||||||
|
"Labels": {
|
||||||
|
"com.example.some-label": "some-value",
|
||||||
|
"com.example.some-other-label": "some-other-value"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
@ -3028,6 +3046,7 @@ Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
"Name":"isolated_nw",
|
"Name":"isolated_nw",
|
||||||
|
"CheckDuplicate":false,
|
||||||
"Driver":"bridge",
|
"Driver":"bridge",
|
||||||
"EnableIPv6": true,
|
"EnableIPv6": true,
|
||||||
"IPAM":{
|
"IPAM":{
|
||||||
|
|
@ -3046,7 +3065,19 @@ Content-Type: application/json
|
||||||
"foo": "bar"
|
"foo": "bar"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Internal":true
|
"Internal":true,
|
||||||
|
"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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -3071,12 +3102,13 @@ Status Codes:
|
||||||
JSON Parameters:
|
JSON Parameters:
|
||||||
|
|
||||||
- **Name** - The new network's name. this is a mandatory field
|
- **Name** - The new network's name. this is a mandatory field
|
||||||
|
- **CheckDuplicate** - Requests daemon to check for networks with same name
|
||||||
- **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver
|
- **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver
|
||||||
- **Internal** - Restrict external access to the network
|
- **Internal** - Restrict external access to the network
|
||||||
- **IPAM** - Optional custom IP scheme for the network
|
- **IPAM** - Optional custom IP scheme for the network
|
||||||
- **EnableIPv6** - Enable IPv6 on the network
|
- **EnableIPv6** - Enable IPv6 on the network
|
||||||
- **Options** - Network specific options to be used by the drivers
|
- **Options** - Network specific options to be used by the drivers
|
||||||
- **CheckDuplicate** - Requests daemon to check for networks with same name
|
- **Labels** - Labels to set on the network, specified as a map: `{"key":"value" [,"key2":"value2"]}`
|
||||||
|
|
||||||
### Connect a container to a network
|
### Connect a container to a network
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue