I was thinking about how to minimise the size of a container image and realised: you can allow read only access to the host libraries 🤯
This extends the idea of distroless images even further as now the distro doesn't need to be bundled in even for dynamically linked binaries.
This of course has some downsides: less isolation and possibly greater security risk, as the container now has access to more code (although you could mount only the needed libs).
It also means this breaks the idea that you can just pull and run an image: now you need to figure out what to mount and where for it to work.
But I think it is insanely cool that you can do this and there are times where even the size of a small distro can make a difference (especially if you multiply that size many times over).
I also wonder if it means you can go back to patching your OS security libraries (libssl and the like) and restart your container to fix security risks, instead of having to rebuild and redeploy every container.
#containers #rustlang (because I was playing with a rust project when I thought of this)






