Public repo to distribute scripts and config's
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 

27 linhas
867 B

  1. #!/bin/sh -e
  2. # This script will setup docker to push all newly created container logs to https://int.loki.grid.tf
  3. # NOTE: existing containers will need to be recreated to send their logs to Loki
  4. ### Install docker plugin
  5. docker plugin install grafana/loki-docker-driver:2.9.2 --alias loki --grant-all-permissions
  6. ### Edit docker daemon config file
  7. cat << EOF > /etc/docker/daemon.json
  8. {
  9. "debug" : true,
  10. "log-driver": "loki",
  11. "log-opts": {
  12. "loki-url": "https://int.loki.grid.tf/loki/api/v1/push",
  13. "loki-batch-size": "400",
  14. "loki-retries": "2",
  15. "loki-max-backoff": "800ms",
  16. "loki-timeout": "1s",
  17. "keep-file": "true"
  18. }
  19. }
  20. EOF
  21. ### Restart docker
  22. systemctl restart docker
  23. echo "Don't forget to recreate all containers that should send their logs to Loki! This config does not apply to existing containers"