glanceapp / glance

A self-hosted dashboard that puts all your feeds in one place
GNU Affero General Public License v3.0
8.48k stars 295 forks source link

Reduce the docker image size further by basing on scratch instead of alpine #22

Closed jarylc closed 6 months ago

jarylc commented 6 months ago

Unfortunately /etc/ssl/certs/ca-certificates.crt is still a dependency, but it's easy enough to just grab it from an Alpine image during build

This shaves off about an additional ~25% (~5mb) of uncompressed image size.

Preferably, we run the build in Docker as well, but since your current workflow builds outside of it, I've decided not to change that.

svilenmarkov commented 6 months ago

Thanks for another contribution!

Realistically yes, I could switch to using scratch over alpine and installing the certificates, and in a production environment it might make sense to do so, but then I (and every user) lose the ability to easily sh into the container and do some basic debugging when needed. I don't think losing the ability to do that is worth saving 5mb.

Preferably, we run the build in Docker as well, but since your current workflow builds outside of it, I've decided not to change that.

Admittedly I'm far from good at building Docker containers which is why I've kept the majority of the build process on the outside, though for the time being it works and does what I need it to. I'm happy to revisit this once the build steps get more complicated and there's a good reason to switch to building in Docker.