Enable Prometheus Formatted Metrics for Synology Docker

  1. Edit /var/packages/Docker/etc/dockerd.json:
    {
      "experimental" : true,
      "metrics-addr" : "0.0.0.0:9999",
    }
    
  2. Restart the Docker package
    synoservice --restart pkgctl-Docker
    

Set Custom DNS Servers

  1. Edit /var/packages/Docker/etc/dockerd.json:
    {
      "dns": ["SERVER_0", "SERVER_1"]
    }
    
  2. Restart the Docker package

Setup Unprivileged Docker Access

  1. Add your user to the docker group:
    synogroup --add docker <your_username>
    
  2. Fix permissions on the Docker socket:
    chown root:docker /var/run/docker.sock
    

Ship Docker Logs to Loki

  1. Install the Loki driver plugin
    docker plugin \
      install \
      grafana/loki-docker-driver:latest \
      --alias loki \
      --grant-all-permissions
    
  2. Change logger per container
    docker run \
      --log-driver=loki \
      --log-opt loki-url="LOKI_URL/loki/api/v1/push" \
      IMAGE
    

Updating Docker Loki Driver

docker plugin disable loki --force
docker plugin upgrade loki grafana/loki-docker-driver:latest --grant-all-permissions
docker plugin enable loki
synoservice --restart pkgctl-Docker