dciancu / unifi-protect-unvr-docker-arm64

UniFi Protect UNVR Docker container for arm64
https://hub.docker.com/r/dciancu/unifi-protect-unvr-docker-arm64
22 stars 0 forks source link

Multi-stage build #2

Closed corny closed 3 months ago

corny commented 3 months ago

The build process could be rewritten to use multi-stage builds and reduce the number of scripts. What do you think?

dciancu commented 3 months ago

Hi, Initially I wrote everything in one big Dockerfile, with multiple stages. Then I needed the firmware packages out of the image for easier testing and development, so I split it between firmware-build and protect. There was also the argument that the protect dockerfile should be separated for easier tracking of changes between firmware versions and any PRs may target this file. Then I further split Dockerfiles for cache handling of the firmware folder (docker build run with --no-cache) and made stages at the CI level for easier understanding of what failed when a build failed. If you were just referring to the shell scripts, they are split as the dockerfiles for clarity.

So this is the reasoning behind the split dockerfiles. If you have a more elegant solution, I am happy to hear from you.

corny commented 3 months ago

Alright, thanks for your explanation, I understand. Amazing work! 👏