Re:Don't expose the docker socket, even to a container
by takeda on Thursday September 24, 2015 @01:09AM
(#10269934)
In that situation you can use LD_LIBRARY_PATH, that's what it is for.
But what you really want in that case is to link the application statically. If you don't want to have benefits of shared objects:
- smaller binary
- memory savings (if multiple programs are using the same library, it is loaded once)
- less files to patch to fix a security vulnerability
The share objects have these features but it comes at price of lower performance, so by putting all .so files into a single docker file instead of statically compiling your application you're getting worst out of both worlds.
But what you really want in that case is to link the application statically. If you don't want to have benefits of shared objects:
- smaller binary - memory savings (if multiple programs are using the same library, it is loaded once) - less files to patch to fix a security vulnerability
The share objects have these features but it comes at price of lower performance, so by putting all .so files into a single docker file instead of statically compiling your application you're getting worst out of both worlds.