egzumer / uv-k5-firmware-custom

A merge between https://github.com/OneOfEleven/uv-k5-firmware-custom and https://github.com/fagci/uv-k5-firmware-fagci-mod
Apache License 2.0
1.33k stars 427 forks source link

Optimized Dockerfile #577

Open alrs opened 6 months ago

alrs commented 6 months ago

This creates a new Dockerfile to be used with the compile-with-docker.sh script.

The original Dockerfile copies code into the container and creates compiled firmware owned by root. This one mounts the repo as a volume under /app. The compilation step is run by the current userid instead of root. The resultant artifacts are correctly chmodded to 644, as they are not executables. The stray copy of firmware.ld that shows up in compiled-firmware is now omitted. This Dockerfile brings in fewer dependencies, in my case decreasing the size of the build container from 4.24GB to 3.75GB.

The same approach could likely be taken with compile-with-docker.bat, but I don't have a Windows system here for development.

Fixes https://github.com/egzumer/uv-k5-firmware-custom/issues/576