flyte / mqtt-io

Expose GPIO modules (Raspberry Pi, Beaglebone, PCF8754, PiFace2 etc.) and digital sensors (LM75 etc.) to an MQTT server for remote control and monitoring.
MIT License
460 stars 157 forks source link

docker: use a "slim" base image #342

Closed chatziko closed 4 months ago

chatziko commented 6 months ago

This tiny PR changes the docker base image from python:3.8-buster to python:3.8-slim-buster. This most likely has no functional difference (tested only on a raspberry pi with gpiod), and reduces the uncompressed image from 855MB to just 144MB (pretty shocking, not sure why such a huge difference).

It also adds --no-cache-dir to pip, which saves a tiny bit more.

BenjiU commented 4 months ago

@chatziko: This changes breaks our delivery. Have you tested building with slim docker? Have you had to change something?

chatziko commented 4 months ago

@chatziko: This changes breaks our delivery. Have you tested building with slim docker? Have you had to change something?

I built (and activelly use in two different raspberry pis) an arm64 image using the exact committed Dockerfile, it worked fine. The exact build command:

docker buildx build --platform=linux/arm64 -t mqtt-io --load  .

I also built (but did not test) and amd64 image without problem.

What kind of problem did you get?

BenjiU commented 4 months ago

@chatziko: hmm, strange... With your changes, we get https://github.com/flyte/mqtt-io/actions/runs/8055315759/job/22002238188#step:6:2738

#29 433.2 Failed to build msgpack
#29 433.2 ERROR: Could not build wheels for msgpack, which is required to install pyproject.toml-based projects

hmm, I need to look, what platform is causing the issue...

chatziko commented 4 months ago

arm/v7 is the problem, #352 likely fixes it.