mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add missing --log-driver and --log-opt docs
Adds documentation for "--log-driver" and "--log-opt" for services. Also updated the API docs to include the new options, and generated a more complete JSON example. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
3d4bde92b7
commit
5ece2a6e0d
4 changed files with 108 additions and 24 deletions
|
@ -3926,33 +3926,68 @@ Create a service
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
"Name": "redis",
|
"Name": "web",
|
||||||
"TaskTemplate": {
|
"TaskTemplate": {
|
||||||
"ContainerSpec": {
|
"ContainerSpec": {
|
||||||
"Image": "redis"
|
"Image": "nginx:alpine",
|
||||||
|
"Mounts": [
|
||||||
|
{
|
||||||
|
"ReadOnly": true,
|
||||||
|
"Source": "web-data",
|
||||||
|
"Target": "/usr/share/nginx/html",
|
||||||
|
"Type": "VOLUME",
|
||||||
|
"VolumeOptions": {
|
||||||
|
"DriverConfig": {
|
||||||
|
},
|
||||||
|
"Labels": {
|
||||||
|
"com.example.something": "something-value"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"User": "33"
|
||||||
},
|
},
|
||||||
|
"LogDriver": {
|
||||||
|
"Name": "json-file",
|
||||||
|
"Options": {
|
||||||
|
"max-file": "3",
|
||||||
|
"max-size": "10M"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Placement": {},
|
||||||
"Resources": {
|
"Resources": {
|
||||||
"Limits": {},
|
"Limits": {
|
||||||
"Reservations": {}
|
"MemoryBytes": 104857600.0
|
||||||
|
},
|
||||||
|
"Reservations": {
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"RestartPolicy": {},
|
"RestartPolicy": {
|
||||||
"Placement": {}
|
"Condition": "on-failure",
|
||||||
|
"Delay": 10000000000.0,
|
||||||
|
"MaxAttempts": 10
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"Mode": {
|
"Mode": {
|
||||||
"Replicated": {
|
"Replicated": {
|
||||||
"Replicas": 1
|
"Replicas": 4
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"UpdateConfig": {
|
"UpdateConfig": {
|
||||||
"Parallelism": 1
|
"Delay": 30000000000.0,
|
||||||
|
"Parallelism": 2
|
||||||
},
|
},
|
||||||
"EndpointSpec": {
|
"EndpointSpec": {
|
||||||
"ExposedPorts": [
|
"Ports": [
|
||||||
{
|
{
|
||||||
"Protocol": "tcp",
|
"Protocol": "tcp",
|
||||||
"Port": 6379
|
"PublishedPort": 8080,
|
||||||
|
"TargetPort": 80
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"Labels": {
|
||||||
|
"foo": "bar"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3986,8 +4021,8 @@ JSON Parameters:
|
||||||
- **User** – A string value specifying the user inside the container.
|
- **User** – A string value specifying the user inside the container.
|
||||||
- **Labels** – A map of labels to associate with the service (e.g.,
|
- **Labels** – A map of labels to associate with the service (e.g.,
|
||||||
`{"key":"value"[,"key2":"value2"]}`).
|
`{"key":"value"[,"key2":"value2"]}`).
|
||||||
- **Mounts** – Specification for mounts to be added to containers created as part of the new.
|
- **Mounts** – Specification for mounts to be added to containers
|
||||||
service.
|
created as part of the service.
|
||||||
- **Target** – Container path.
|
- **Target** – Container path.
|
||||||
- **Source** – Mount source (e.g. a volume name, a host path).
|
- **Source** – Mount source (e.g. a volume name, a host path).
|
||||||
- **Type** – The mount type (`bind`, or `volume`).
|
- **Type** – The mount type (`bind`, or `volume`).
|
||||||
|
@ -4003,6 +4038,11 @@ JSON Parameters:
|
||||||
- **Options** - key/value map of driver specific options.
|
- **Options** - key/value map of driver specific options.
|
||||||
- **StopGracePeriod** – Amount of time to wait for the container to terminate before
|
- **StopGracePeriod** – Amount of time to wait for the container to terminate before
|
||||||
forcefully killing it.
|
forcefully killing it.
|
||||||
|
- **LogDriver** - Log configuration for containers created as part of the
|
||||||
|
service.
|
||||||
|
- **Name** - Name of the logging driver to use (`json-file`, `syslog`,
|
||||||
|
`journald`, `gelf`, `fluentd`, `awslogs`, `splunk`, `etwlogs`, `none`).
|
||||||
|
- **Options** - Driver-specific options.
|
||||||
- **Resources** – Resource requirements which apply to each individual container created as part
|
- **Resources** – Resource requirements which apply to each individual container created as part
|
||||||
of the service.
|
of the service.
|
||||||
- **Limits** – Define resources limits.
|
- **Limits** – Define resources limits.
|
||||||
|
|
|
@ -3927,33 +3927,68 @@ Create a service
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
{
|
{
|
||||||
"Name": "redis",
|
"Name": "web",
|
||||||
"TaskTemplate": {
|
"TaskTemplate": {
|
||||||
"ContainerSpec": {
|
"ContainerSpec": {
|
||||||
"Image": "redis"
|
"Image": "nginx:alpine",
|
||||||
|
"Mounts": [
|
||||||
|
{
|
||||||
|
"ReadOnly": true,
|
||||||
|
"Source": "web-data",
|
||||||
|
"Target": "/usr/share/nginx/html",
|
||||||
|
"Type": "VOLUME",
|
||||||
|
"VolumeOptions": {
|
||||||
|
"DriverConfig": {
|
||||||
|
},
|
||||||
|
"Labels": {
|
||||||
|
"com.example.something": "something-value"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"User": "33"
|
||||||
},
|
},
|
||||||
|
"LogDriver": {
|
||||||
|
"Name": "json-file",
|
||||||
|
"Options": {
|
||||||
|
"max-file": "3",
|
||||||
|
"max-size": "10M"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Placement": {},
|
||||||
"Resources": {
|
"Resources": {
|
||||||
"Limits": {},
|
"Limits": {
|
||||||
"Reservations": {}
|
"MemoryBytes": 104857600.0
|
||||||
|
},
|
||||||
|
"Reservations": {
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"RestartPolicy": {},
|
"RestartPolicy": {
|
||||||
"Placement": {}
|
"Condition": "on-failure",
|
||||||
|
"Delay": 10000000000.0,
|
||||||
|
"MaxAttempts": 10
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"Mode": {
|
"Mode": {
|
||||||
"Replicated": {
|
"Replicated": {
|
||||||
"Replicas": 1
|
"Replicas": 4
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"UpdateConfig": {
|
"UpdateConfig": {
|
||||||
"Parallelism": 1
|
"Delay": 30000000000.0,
|
||||||
|
"Parallelism": 2
|
||||||
},
|
},
|
||||||
"EndpointSpec": {
|
"EndpointSpec": {
|
||||||
"ExposedPorts": [
|
"Ports": [
|
||||||
{
|
{
|
||||||
"Protocol": "tcp",
|
"Protocol": "tcp",
|
||||||
"Port": 6379
|
"PublishedPort": 8080,
|
||||||
|
"TargetPort": 80
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"Labels": {
|
||||||
|
"foo": "bar"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3987,8 +4022,8 @@ JSON Parameters:
|
||||||
- **User** – A string value specifying the user inside the container.
|
- **User** – A string value specifying the user inside the container.
|
||||||
- **Labels** – A map of labels to associate with the service (e.g.,
|
- **Labels** – A map of labels to associate with the service (e.g.,
|
||||||
`{"key":"value"[,"key2":"value2"]}`).
|
`{"key":"value"[,"key2":"value2"]}`).
|
||||||
- **Mounts** – Specification for mounts to be added to containers created as part of the new.
|
- **Mounts** – Specification for mounts to be added to containers
|
||||||
service.
|
created as part of the service.
|
||||||
- **Target** – Container path.
|
- **Target** – Container path.
|
||||||
- **Source** – Mount source (e.g. a volume name, a host path).
|
- **Source** – Mount source (e.g. a volume name, a host path).
|
||||||
- **Type** – The mount type (`bind`, or `volume`).
|
- **Type** – The mount type (`bind`, or `volume`).
|
||||||
|
@ -4004,6 +4039,11 @@ JSON Parameters:
|
||||||
- **Options** - key/value map of driver specific options.
|
- **Options** - key/value map of driver specific options.
|
||||||
- **StopGracePeriod** – Amount of time to wait for the container to terminate before
|
- **StopGracePeriod** – Amount of time to wait for the container to terminate before
|
||||||
forcefully killing it.
|
forcefully killing it.
|
||||||
|
- **LogDriver** - Log configuration for containers created as part of the
|
||||||
|
service.
|
||||||
|
- **Name** - Name of the logging driver to use (`json-file`, `syslog`,
|
||||||
|
`journald`, `gelf`, `fluentd`, `awslogs`, `splunk`, `etwlogs`, `none`).
|
||||||
|
- **Options** - Driver-specific options.
|
||||||
- **Resources** – Resource requirements which apply to each individual container created as part
|
- **Resources** – Resource requirements which apply to each individual container created as part
|
||||||
of the service.
|
of the service.
|
||||||
- **Limits** – Define resources limits.
|
- **Limits** – Define resources limits.
|
||||||
|
|
|
@ -24,6 +24,8 @@ Options:
|
||||||
-l, --label value Service labels (default [])
|
-l, --label value Service labels (default [])
|
||||||
--limit-cpu value Limit CPUs (default 0.000)
|
--limit-cpu value Limit CPUs (default 0.000)
|
||||||
--limit-memory value Limit Memory (default 0 B)
|
--limit-memory value Limit Memory (default 0 B)
|
||||||
|
--log-driver string Logging driver for service
|
||||||
|
--log-opt value Logging driver options (default [])
|
||||||
--mode string Service mode (replicated or global) (default "replicated")
|
--mode string Service mode (replicated or global) (default "replicated")
|
||||||
--mount value Attach a mount to the service
|
--mount value Attach a mount to the service
|
||||||
--name string Service name
|
--name string Service name
|
||||||
|
|
|
@ -29,6 +29,8 @@ Options:
|
||||||
--label-rm value Remove a label by its key (default [])
|
--label-rm value Remove a label by its key (default [])
|
||||||
--limit-cpu value Limit CPUs (default 0.000)
|
--limit-cpu value Limit CPUs (default 0.000)
|
||||||
--limit-memory value Limit Memory (default 0 B)
|
--limit-memory value Limit Memory (default 0 B)
|
||||||
|
--log-driver string Logging driver for service
|
||||||
|
--log-opt value Logging driver options (default [])
|
||||||
--mount-add value Add or update a mount on a service
|
--mount-add value Add or update a mount on a service
|
||||||
--mount-rm value Remove a mount by its target path (default [])
|
--mount-rm value Remove a mount by its target path (default [])
|
||||||
--name string Service name
|
--name string Service name
|
||||||
|
|
Loading…
Add table
Reference in a new issue