Closed derlaft closed 1 year ago
Hey there, thanks for reaching out.
I did some local builds on arm64 and could achieve these image sizes with your suggestions, this is really great. 😃
Image | Size before | Size after |
---|---|---|
klipper | 852M | 397M |
moonraker | 328M | 269M |
ustreamer | 112M | 98.1M |
These changes are Implemented with https://github.com/mkuf/prind/commit/c43891deca7905b3b3ec80a5436d4b75f72fade4 and will be part of Release v1.3.0
-Markus
Hi,
There are a couple of issues making
klipper
image significantly larger than it should be:Here you can remove
.git
folder aftergit checkout
. This saves around 80M:https://github.com/mkuf/prind/blob/82675ddf80fd1ad8009e407708cbc43c71cf0773/docker/klipper/Dockerfile#L9-L11
Here you can try using
COPY --chown
instead of a separateCOPY
andRUN chown
. Otherwise all the files are duplicated in a new layer:https://github.com/mkuf/prind/blob/82675ddf80fd1ad8009e407708cbc43c71cf0773/docker/klipper/Dockerfile#L23-L30
Those two simple changes should result in pull size reduction from ~720M to ~350M (for armv7).
I would have liked to created a platform, but I'm using that to try to run klipper on a machine without docker, so I don't have an easy way to test the changes....