
Create lean Node.js image with Docker multi-stage build - jeremyliew
https://codefresh.io/blog/node_docker_multistage/
======
NationLider
Seriously this! I've seen so many developers build giant unwieldy images
because there's been no easy way to manage build dependencies that didn't end
with bloat. This is a big win for Docker.

~~~
dozzie
> I've seen so many developers build giant unwieldy images because there's
> been no easy way to manage build dependencies that didn't end with bloat.

Uhm... What? No, there was, around two decades older than Docker itself. It's
just that developers avoid using tools that were written for sysadmins.

If you build a binary package with your application and another one with your
application's dependencies, you avoid all that bloat you mention. Though it's
not sexy, because it's an old method and uses things already present in
operating system.

------
jeremyliew
Something else great about multi-stage builds is that you can actually put all
your unit tests in as part of the build flow. It should make CI more portable.

------
robinson_k
Great writeup. I know this post is just about Node but the implications for
every language are pretty huge.

