Docker library sharing from host to container

From HPCWIKI
Jump to navigation Jump to search

From Docker and micro service point of view, the best practices of Docker are to package the library into the image, and not rely on a library file being present on the host. however, sometime sharing host library to container would be helpful to reduce redundancy and reduce size of Docker images.


One of example would be CUDA tool kit, for example, install various version of CUDA toolkit on host and volume mouting when container start with read only. this method will save significant amount of storage space of docker image size and layers and easy to change version of CUDA for the application inside of container.

References