<p>My project has an application server and a C++ library. The library is not dependent on the application server. The vendor has a Docker image for the application server. I need to deploy a C++ library that needs to be accessible from each of the application server nodes/pods.</p>

<p>I've written a Dockerfile that builds on the vendors image, compiling and copying the libraries into place. It works, however, every time there's a new version of the application server I need to build my C++ library again from scratch. Given the lack of dependencies these doesn't seem optimal.</p>

<p>Naively, what I was expecting was to be able to build the C++ library into an "empty" image and mount that (like a filesystem) in each pod. That way the server and the library are maintained separately.</p>

<p>Is building on the vendor Dockerfile the "right" way to architect this? Or is there a solution more like my "idealised" vision?</p>

<p>I expect the answer is obvious and I just need the right terminology to search for... pointers very much appreciated.</p>

<p>As you said you can build the C++ library into an "empty" image. And for all the deployments you can use this as base image. This way you can avoid building library for every deployment.</p>

<p>Ex: Build image with C++ Library. Lets call this lib-img.
When vendor is building image, vendor can use lib-img as base image, you can also add additional dependencies to lib-img which are needed by vendor.</p>

<p>You can also use init containers to pull the library on the pods.</p>
