guacsec / guac-visualizer

Visualizer for GUAC
https://guac.sh/
26 stars 21 forks source link

Reduce guac-visualizer container image size. Container image size is larger than expected (1.4GB). #79

Closed tuananh closed 1 month ago

tuananh commented 8 months ago

I expect the image would be much smaller

lumjjb commented 7 months ago

Agreed. Renaming this issue to reflect the desired outcome and adding some issue tags!

tuananh commented 6 months ago

Agreed. Renaming this issue to reflect the desired outcome and adding some issue tags!

Are you open to moving away from buildpack? Customize buildpack is kind of limited

nitram509 commented 1 month ago

Just build the image locally and can confirm 1,11 GB in size. the 1,11GB stem from some optimization tests. When I build the image, as configured in this repo, the image size is 2,12 GB

I did some investigation and found out:

Screenshot 2024-10-12 at 00 08 27

nitram509 commented 1 month ago

Having some idea to shape off some megabytes, using buildpack ... and also tinkering with building Docker image from a Dockerfile with more control and tweaking of the size. I estimate to get below 500MB is possible, when dropping many of the node_modules dependencies - as they are not used, when pre-compiling via next.js is done.

Are you open for an alternative solution, using native docker tooling and a Dockerfile, instead of buildpacks (to be removed then) ?

Would you please assign me to this task - I want to work on it.

lumjjb commented 1 month ago

assigned! Thanks for taking a look at this!

the "application layer" are the SBOMs ... and I guess you want to keep them.

hmm i don't think its necessary to keep the SBOMs for the guac visualizer itself in the container image. @pxp928 @jeffmendoza.. If this is the 7+MB one i think its fine to keep but if this belongs to the 200+MB category i think its fine to remove.

nitram509 commented 1 month ago

@lumjjb thank you for your feedback. May I ask, what's your opinion about replacing buildpack tools with native Docker tools, to get it even smaller? (see above comment https://github.com/guacsec/guac-visualizer/issues/79#issuecomment-2408553211)