-
Notifications
You must be signed in to change notification settings - Fork 51
Simplify kuksa-client docker build and reducing resulting image size #683
Simplify kuksa-client docker build and reducing resulting image size #683
Conversation
Signed-off-by: Sebastian Schildt <[email protected]>
Signed-off-by: Sebastian Schildt <[email protected]>
74cfdd1
to
988d523
Compare
RUN apk update && apk add git alpine-sdk linux-headers | ||
RUN pip install --upgrade pip build | ||
|
||
FROM python:3.10-slim-bookworm as build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we possibly document our strategy (and experiences) for Docker environments somewhere. Like, should we stop using alpine everywhere? Today we have a quite big mix, and are there not some possible benefits of using the same environment as often as possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"probably", although I think it might differ depending on technology
So "historically" there was Alpine used, as for the C++ Val-Server it really made a difference size-wise.
For Python based things the savings are not that large, and using glibc builds are just easiest. Current stable debian just seems a common choice in many docker workloads. The solution here basically already includes learnings from the past , e.g. the pyinstaller technique from DBC feeder, except it does not condense all pyinstaller collected things in one file (as it does not offer benefits inside a container, but a runtime penalty unpacking it)
For rust it is a bit different, as we are using "from scratch" images (e.g. only one binary in the container, no distro), and glibc isn't really suited to be statically linked - you CAN do it, but then some rust crates/dependecies break that, hence we have MUSL there.
tldr; We should, I think this on represents our current "best practice" in pyhton, and maybe we should adapt our python stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a very basic check:
- Download container
- Start it and verify that KUKSA client starts and connect successfully to Databroker (insecure mode)
That worked, that is good enough for me
I tested secure. lgtm. |
This fixes #682
On a high level
This fixes the huge size of the arm image, while at the same time even reducing the amd64 image compared to master
Arm64 size now