I&#x27;m pretty new to Docker, so I&#x27;m curious about &quot;a project with 75 gems&#x2F;packages and a couple of native extensions that need to be compiled&quot;...<p>Is the common procedure in the Docker world to build an application image that includes all the build tools that were used to build native dependencies?  That seems like it does generate a pretty large image.<p>I figured I&#x27;d take a three-step approach to my first node.js app in Docker:<p>1. Build an image to build my dependencies.  This uses the same base image as step #2 will, but installs all the development tools and libraries (eg. build-essentials, libpq5-dev), and then outputs a .tar.gz to a shared volume containing my node_modules folder.<p>2. Build an image with my dependencies; imports the runtime versions of any libraries (eg. libpq5), imports &amp; expands the .tar.gz generated by #1.<p>3. Build an image with my application, FROM the image in #2.<p>The process is optimized by having the automation check for the existence of #2 by hashing the contents of the relevant Dockerfiles, and the package.json list of dependencies, and doing a `docker pull` with that hash to see if I&#x27;ve already built #2.  If so, my build just needs to build #3.<p>It&#x27;s a bit more complex (Hello, everything in Docker-land), but ends up being pretty powerful.  But your post makes me think I&#x27;ve over-complexified it a bit.