openresty / docker-openresty

Docker tooling for OpenResty
https://hub.docker.com/r/openresty/openresty
BSD 2-Clause "Simplified" License
935 stars 525 forks source link

Docker fat image reduction #228

Open sshumov opened 1 year ago

sshumov commented 1 year ago

almost 3 times smaller fat images by removing unused alpine packages original size: REPOSITORY TAG IMAGE ID CREATED SIZE test latest f3a4fb6875e7 About a minute ago 396MB fix: REPOSITORY TAG IMAGE ID CREATED SIZE test-fix-size latest 6034bc75cd29 4 seconds ago 108MB test latest f3a4fb6875e7 2 minutes ago 396MB

neomantra commented 1 year ago

Hello, thanks for the contribution. I understand what you are doing -- moving some packages to be auto-removed at the end. I also appreciate the significant size reduction....

But, this is a weird image. It was called fat because it is larger and has those many installed packages. Those weren't necessarily intended to be solely build-dependencies for luarocks itself, but also for many other common packages that seem to be needed by other rocks. It was also intended to be an example of deriving images from the base openresrty image.

I'm weary of changing the included packages. It might affect users who derive FROM it. If a new user is really concerned about size, they can see how to derive an as-slim-as-possible image from these.

However, maybe there is some other new image flavor (meaning like -fat) that is needed? Why/how are you using the fat images?

EDIT TO ADD: Maybe it's more OK to change the -fat contents with a significant tag change, like the forthcoming 1.21.4.2