Docker Driver Client

Loki officially supports a Docker plugin that will read logs from Dockercontainers and ship them to Loki. The plugin can be configured to send the logsto a private Loki instance or Grafana Cloud.

Docker plugins are not yet supported on Windows; see theDocker docs for more information.

Documentation on configuring the Loki Docker Driver can be found on theconfiguration page.

Installing

The Docker plugin must be installed on each Docker host that will be runningcontainers you want to collect logs from.

Run the following command to install the plugin:

  1. docker plugin install grafana/loki-docker-driver:latest --alias loki
  2. --grant-all-permissions

To check installed plugins, use the docker plugin ls command. Plugins thathave started successfully are listed as enabled:

  1. $ docker plugin ls
  2. ID NAME DESCRIPTION ENABLED
  3. ac720b8fcfdb loki Loki Logging Driver true

Once the plugin is installed it can be configured.

Upgrading

The upgrade process involves disabling the existing plugin, upgrading, and thenre-enabling:

  1. docker plugin disable loki
  2. docker plugin upgrade loki grafana/loki-docker-driver:master
  3. docker plugin enable loki

Uninstalling

To cleanly uninstall the plugin, disable and remove it:

  1. docker plugin disable loki
  2. docker plugin rm loki