miflora-mqtt-daemon icon indicating copy to clipboard operation
miflora-mqtt-daemon copied to clipboard

Docker container

Open AnderssonPeter opened this issue 6 years ago β€’ 9 comments

Any chance you could create a docker container for raspberry pi 3?

AnderssonPeter avatar May 12 '18 12:05 AnderssonPeter

Hey, I am not using docker on the RPi but please provide a Dockerfile if you build one. Shouldn't be too hard. I imagine a base image plus a set of RUN instructions for what is already documented here: https://github.com/ThomDietrich/miflora-mqtt-daemon#installation

ThomDietrich avatar May 19 '18 13:05 ThomDietrich

For Docker it is somehow disturbing that the app file (.py) and config.ini reside in the same directory. I made a change to allow for an additional config directory command line argument. Then, this could be stored in a permanent volume, whereas the code and its dependencies would be inside the container.

One I find out how to create a PR, I will do so.

Lars

LarsAC avatar May 28 '18 20:05 LarsAC

Sounds reasonable. Let's make it a configurable config file argument though. Please send a PR our way ;)

ThomDietrich avatar May 28 '18 23:05 ThomDietrich

Did so along with a fix for #39. This is my first PR ever and I am very excited ;-)

Please advice if this stuff works for you.

Lars

LarsAC avatar May 30 '18 22:05 LarsAC

The Dockerfile works great on a RPi 3 (ARMv8), but not for a RPi 0 (ARMv6). Here's the error

Step 3/10 : RUN mkdir -p /usr/src/app
 ---> Running in bc5f5ed8eedf
ERROR: Service 'miflora-mqtt-daemon' failed to build: The command '/bin/sh -c mkdir -p /usr/src/app' returned a non-zero code: 139

I switched the image to FROM resin/raspberry-pi-python:3.6.1 and the Python call to CMD [ "python", "./miflora-mqtt-daemon.py", "--config_dir", "/config" ] and it spins up.

iicky avatar Aug 31 '18 16:08 iicky

@LarsAC would you like to create a tested PR for this change by @iicky

@iicky thanks!

ThomDietrich avatar Nov 06 '18 12:11 ThomDietrich

Can do, will add a second Dockerfile for rpi.

Lars

LarsAC avatar Nov 08 '18 06:11 LarsAC

Please consider PR #59, for arm32v6 (RPI 1, 2, 3 and Zero), arm32v7 (RPI 1, 2, 3) and arm64v8 (pine64) support.

Ray

RaymondMouthaan avatar Nov 13 '18 12:11 RaymondMouthaan

:+1: can we also get this into the hassio addons repository? its possible to scrape miflora sensors from hass directly, but the units & names in the miflora component do not align with the units/names created with this daemon. I'd prefer to just use this tool everywhere and turn off the miflora component completely.

bigkraig avatar Jan 28 '19 18:01 bigkraig