ThomDietrich / miflora-mqtt-daemon

Linux service to collect and transfer Xiaomi Mi Flora plant sensor data via MQTT to your smart home system, with cluster support 🌱🌼πŸ₯€πŸ‘🌳
MIT License
607 stars 139 forks source link

[ docker ] Change to Alpine based image #95

Open thmang82 opened 4 years ago

thmang82 commented 4 years ago

Would be nice to change the Docker Python base image from Debian Stretch to Alpine based. The current Dockerfile creates a really huge image:

python                            3-stretch      1cbc680aad7a        3 months ago        747MB
miflora-mqtt-daemon    latest            cc2a8aaxxxxx     13 seconds ago        800MB

I tested an Alpine based image and it works. Changed lines:

FROM python:3-alpine
...
RUN apk update && apk add bluez bluez-deprecated
...

The result:

python                           3-alpine         de4bca259e45        16 hours ago        81.2MB
miflora-mqtt-daemon  latest              3380c53xxxxx    58 seconds ago       143MB

The difference in size and build time is huge! Never waste resources ;-)

ThomDietrich commented 4 years ago

I totally agree from a general docker perspective. Would you be able to propose a tested PR?