Why load an OS at all?

I have been building a runtime with several nodejs services as separate images, built on debian wheezy. Each one needs “build-essential” package, which is fairly large. My first thought was to have one image to build the node_modules, and then have the others mount them.

But why stop there? Could I have one image which has debian, to give myself a consistent OS, then have the other images mount the OS (readonly – or copy the bits like /etc/ that they need to keep separate).

Are there any pitfalls to this? Googling I haven’t come up with this pattern.

EDIT: @Andy on stackoverflow reminds me that there is only one copy of files that aren’t changed if they are derived from the same base. So… nevermind…!

yup, as @Andy pointed out - you’re basically re-implementing what Docker already does for you.