When new pip dependencies are added to Tasmota, pip install fails with
WARNING: The directory '/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
This is due to the image being built with all folders belonging to root while the container is ran with -u $UID:$GID (otherwise the user won't have access to the generated files)
This error is the one that required the addition of RUN pip install zopfli
The fix is to create 2 folders /.cache and /.local and give full access to everyone so pip install can work as expected.
Not only the dedicated line for zopfli is no more needed (as it will be dynamically installed during build execution) but it also solve the installation of the new requirement for tasmota_metrics
Also replace the RUN platformio platform update by RUN pio pkg update as recommended by the obsolecence warning.
When new pip dependencies are added to Tasmota, pip install fails with
This is due to the image being built with all folders belonging to
root
while the container is ran with-u $UID:$GID
(otherwise the user won't have access to the generated files)This error is the one that required the addition of
RUN pip install zopfli
The fix is to create 2 folders
/.cache
and/.local
and give full access to everyone sopip install
can work as expected. Not only the dedicated line forzopfli
is no more needed (as it will be dynamically installed during build execution) but it also solve the installation of the new requirement fortasmota_metrics
Also replace the
RUN platformio platform update
byRUN pio pkg update
as recommended by the obsolecence warning.