Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mount in the docker driver. #2295

Merged
merged 2 commits into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions cmd/docker-driver/config.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
{
"description": "Loki Logging Driver",
"documentation": "https://github.com/grafana/loki",
"entrypoint": ["/bin/docker-driver"],
"entrypoint": [
"/bin/docker-driver"
],
"network": {
"type": "host"
},
"interface": {
"types": ["docker.logdriver/1.0"],
"types": [
"docker.logdriver/1.0"
],
"socket": "loki.sock"
},
"env": [
{
"name": "LOG_LEVEL",
"description": "Set log level to output for plugin logs",
"value": "info",
"settable": ["value"]
}
],
"mounts": [
{
"name": "data",
"description": "Optional external pipeline files",
"source": "",
"destination": "/data",
"type": "none",
"options": ["bind", "ro"],
"settable": ["source", "destination"]
"settable": [
"value"
]
}
]
}
31 changes: 0 additions & 31 deletions docs/clients/docker-driver/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,37 +109,6 @@ Custom labels can be added using the `loki-external-labels`,
`loki-pipeline-stage-file`, `labels`, `env`, and `env-regex` options. See the
next section for all supported options.

## Configure custom pipeline stage file

You can also use custom pipeline stage files, with `loki-pipeline-stage-file` option,
provided from outside of the Loki logging driver container by running Loki with a
mounted volume. To do so, you'll need to disable the plugin, set a volume mount
options and enable the plugin again:

```bash
docker plugin disable loki:latest
docker plugin set loki:latest data.source=/etc/pipelines
docker plugin enable loki:latest
```

In the example above the directory `/etc/pipelines` will be mounted as `/data`
inside the Loki driver container and `loki-pipeline-stage-file` option can be
passed with a custom pipeline configuration, provided there's a file
`/etc/pipelines/mypipeline.yaml` on the host machine:

```bash
docker run --log-driver=loki \
--log-opt loki-url="https://<user_id>:<password>@logs-us-west1.grafana.net/loki/api/v1/push" \
--log-opt loki-pipeline-stage-file=/data/mypipeline.yaml \
grafana/grafana
```

Available options are:

- `data.source`: the source directory the volume
- `data.destination`: the path where the directory is mounted in the container,
and is `/data` by default

## Supported log-opt options

The following are all supported options that the Loki logging driver supports:
Expand Down