title: Custom fonts in rrdgraph in a Docker container running Alpine Linux
body: <p>I'm unable to use other fonts than the standard one in rrdgraph.</p>
  
  <p>It may have to do with the fact, that this Alpine has no GUI (all the X-stuff), I don't know.</p>
  
  <p>I found this issue <a href="https://bugs.alpinelinux.org/issues/1475" rel="nofollow">https://bugs.alpinelinux.org/issues/1475</a> dealing with missing fonts, but installing those packages doesn't help.</p>
  
  <p>This is my Dockerfile</p>
  
  <pre><code>FROM alpine:3.3
  
  RUN apk --update add \
        build-base python-dev \
        ca-certificates python \
        py-pip \
        py-jinja2 \
        py-dateutil \
        py-tz \
        py-requests \
        py-pillow \
        py-rrd &amp;&amp; \
      pip install --upgrade arrow \
                            websocket-client \
                            XlsxWriter &amp;&amp; \
      apk del build-base python-dev &amp;&amp; \
      rm -rf /var/cache/apk/* &amp;&amp; \
      echo "iot"
  
  CMD ["/bin/sh"]
  </code></pre>
  
  <p>I added those font packages manually later on with a <code>docker exec -it iot /bin/sh</code></p>
  
  <p>I tried stuff like</p>
  
  <pre><code>  # rrd_graph_fmt += ["--font", "LEGEND:8:'/home/user/data/fonts/Roboto-Regulars.ttf'"]
    # rrd_graph_fmt += ["--font", "LEGEND:8:font-sony-misc"]
  </code></pre>
  
  <p>but it just doesn't work. I'm not even sure how to change the font globally by using environment variables. I tried (some stuff on the web with the env vars), but it didn't work.</p>
  
  <p>I'd really love to use ttf fonts, but would settle with those in the packages if neccessary.</p>
  
  <p>I'm using the rrdtool lib from the py-rrd package.</p>
  
  <p>Does anyone have an idea on how to get this working?</p>