docs: move --log-driver to docker run reference

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2023-11-23 14:25:06 +01:00
parent 72df1960e1
commit 4a6cde8859
2 changed files with 19 additions and 27 deletions

View File

@ -71,7 +71,7 @@ Create and run a new container from an image
| `--label-file` | `list` | | Read in a line delimited file of labels | | `--label-file` | `list` | | Read in a line delimited file of labels |
| `--link` | `list` | | Add link to another container | | `--link` | `list` | | Add link to another container |
| `--link-local-ip` | `list` | | Container IPv4/IPv6 link-local addresses | | `--link-local-ip` | `list` | | Container IPv4/IPv6 link-local addresses |
| `--log-driver` | `string` | | Logging driver for the container | | [`--log-driver`](#log-driver) | `string` | | Logging driver for the container |
| `--log-opt` | `list` | | Log driver options | | `--log-opt` | `list` | | Log driver options |
| `--mac-address` | `string` | | Container MAC address (e.g., 92:d0:c6:0a:29:33) | | `--mac-address` | `string` | | Container MAC address (e.g., 92:d0:c6:0a:29:33) |
| [`-m`](#memory), [`--memory`](#memory) | `bytes` | `0` | Memory limit | | [`-m`](#memory), [`--memory`](#memory) | `bytes` | `0` | Memory limit |
@ -1162,6 +1162,24 @@ The `--add-host` flag also accepts a `:` separator, for example:
$ docker run --add-host=my-hostname:8.8.8.8 --rm -it alpine $ docker run --add-host=my-hostname:8.8.8.8 --rm -it alpine
``` ```
## <a name="log-driver"></a> Logging drivers (--log-driver)
The container can have a different logging driver than the Docker daemon. Use
the `--log-driver=<DRIVER>` with the `docker run` command to configure the
container's logging driver.
To learn about the supported logging drivers and how to use them, refer to
[Configure logging drivers](https://docs.docker.com/config/containers/logging/configure/).
To disable logging for a container, set the `--log-driver` flag to `none`:
```console
$ docker run --log-driver=none -d nginx:alpine
5101d3b7fe931c27c2ba0e65fd989654d297393ad65ae238f20b97a020e7295b
$ docker logs 5101d3b
Error response from daemon: configured logging driver does not support reading
```
### <a name="ulimit"></a> Set ulimits in container (--ulimit) ### <a name="ulimit"></a> Set ulimits in container (--ulimit)
Since setting `ulimit` settings in a container requires extra privileges not Since setting `ulimit` settings in a container requires extra privileges not

View File

@ -888,32 +888,6 @@ drwxrwxr-x 1 1000 1000 4096 Dec 4 06:11 .git
The default seccomp profile will adjust to the selected capabilities, in order to allow The default seccomp profile will adjust to the selected capabilities, in order to allow
use of facilities allowed by the capabilities, so you should not have to adjust this. use of facilities allowed by the capabilities, so you should not have to adjust this.
## Logging drivers (--log-driver)
The container can have a different logging driver than the Docker daemon. Use
the `--log-driver=VALUE` with the `docker run` command to configure the
container's logging driver. The following options are supported:
| Driver | Description |
|:-------------|:-------------------------------------------------------------------------------------------------------------------------------|
| `none` | Disables any logging for the container. `docker logs` won't be available with this driver. |
| `local` | Logs are stored in a custom format designed for minimal overhead. |
| `json-file` | Default logging driver for Docker. Writes JSON messages to file. No logging options are supported for this driver. |
| `syslog` | Syslog logging driver for Docker. Writes log messages to syslog. |
| `journald` | Journald logging driver for Docker. Writes log messages to `journald`. |
| `gelf` | Graylog Extended Log Format (GELF) logging driver for Docker. Writes log messages to a GELF endpoint likeGraylog or Logstash. |
| `fluentd` | Fluentd logging driver for Docker. Writes log messages to `fluentd` (forward input). |
| `awslogs` | Amazon CloudWatch Logs logging driver for Docker. Writes log messages to Amazon CloudWatch Logs. |
| `splunk` | Splunk logging driver for Docker. Writes log messages to `splunk` using Event Http Collector. |
| `etwlogs` | Event Tracing for Windows (ETW) events. Writes log messages as Event Tracing for Windows (ETW) events. Only Windows platforms. |
| `gcplogs` | Google Cloud Platform (GCP) Logging. Writes log messages to Google Cloud Platform (GCP) Logging. |
| `logentries` | Rapid7 Logentries. Writes log messages to Rapid7 Logentries. |
The `docker logs` command is available only for the `json-file` and `journald`
logging drivers. For detailed information on working with logging drivers, see
[Configure logging drivers](https://docs.docker.com/config/containers/logging/configure/).
## Overriding Dockerfile image defaults ## Overriding Dockerfile image defaults
When a developer builds an image from a [*Dockerfile*](https://docs.docker.com/engine/reference/builder/) When a developer builds an image from a [*Dockerfile*](https://docs.docker.com/engine/reference/builder/)