Docker Driver Client
The Docker plugin for Grafana Loki enables you to send logs from Docker containers to Loki or Grafana Cloud.
Docker plugins are not supported on Windows. Refer to the Docker Engine managed plugin system for more details.
For detailed configuration, see the Loki Docker Driver documentation. If you encounter issues, open an issue in the Loki GitHub repository.
Installation
To install the Docker plugin on each Docker host, use the following command (replace the version and architecture as needed):
docker plugin install grafana/loki-docker-driver:3.3.2-arm64 --alias loki --grant-all-permissions
For ARM64 hosts, append -arm64 to the version.
To verify the plugin installation, run:
docker plugin ls
Expected output:
ID NAME DESCRIPTION ENABLED
ac720b8fcfdb loki Loki Logging Driver true
Once installed, configure the plugin.
Upgrade Process
Follow these steps to upgrade the Docker driver:
docker plugin disable loki --force
docker plugin upgrade loki grafana/loki-docker-driver:3.3.2-arm64 --grant-all-permissions
docker plugin enable loki
systemctl restart docker
Note
Update the version number as required.
Uninstallation
To uninstall the Docker plugin, run:
docker plugin disable loki --force
docker plugin rm loki
Known Issue: Deadlocked Docker Daemon
If Loki is unreachable and max_retries is exceeded, logs are dropped. To avoid this:
- Set
max_retries=0to allow unlimited retries. - Adjust settings to reduce daemon lock time:
loki-retries=2loki-max-backoff=800msloki-timeout=1skeep-file=true
Use the Promtail Docker target or Docker service discovery to bypass this issue.