Browse Source

set env var MPLCONFIGDIR

```
WARNING (MainThread) [matplotlib] Matplotlib created a temporary config/cache directory at /tmp/matplotlib-[...] because the default path (/home/hass/.config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.
```
Fabian Peter Hammerle 3 years ago
parent
commit
69fe1a4dcd
2 changed files with 5 additions and 0 deletions
  1. 1 0
      CHANGELOG.md
  2. 4 0
      Dockerfile

+ 1 - 0
CHANGELOG.md

@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
   - `org.opencontainers.image.revision` (git commit hash via build arg)
   - `org.opencontainers.image.source` (repo url)
   - `org.opencontainers.image.title`
+- set env var `MPLCONFIGDIR=/config/matplotlib`
 
 ## [1.0.2] - 2020-05-03
 ### Fixed

+ 4 - 0
Dockerfile

@@ -35,6 +35,10 @@ RUN python3 -c 'import os; assert os.geteuid() == 0, "finally..."' \
     && mkdir -p ~hass/.config/pip \
     && echo -e '[install]\nuser = yes' > ~hass/.config/pip/pip.conf
 VOLUME /config
+# > WARNING (MainThread) [matplotlib] Matplotlib created a temporary config/cache directory at /tmp/matplotlib-[...] \
+# > it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, \
+# > in particular to speed up the import of Matplotlib and to better support multiprocessing.
+ENV MPLCONFIGDIR=/config/matplotlib
 USER hass
 
 # > $ docker inspect --format '{{json .Config.Entrypoint}}' homeassistant/home-assistant:0.106.6