You may want to try this: Idea: runtime/slim images - #30 by ratranqu
It’s a bit old now, but should still work.