Implications of exposing /var/lib/docker over NFS to serve hosts with limited memory

亡梦爱人 提交于 2019-12-08 08:35:10

问题


What are the implications of exporting /var/lib/docker over NFS? The idea is to store the docker images in a server and export it to hosts which has limited memory to store and run containers. This would be useful to avoid having each host download and store it's own library of docker image. The hosts may make use of FS-Cache to limit the data transfer over network.


回答1:


The /var/lib/docker directory is designed to be exclusively accessed by a single daemon, and should never be shared with multiple daemons.

Having multiple daemons use the same /var/lib/docker can lead to many issues, and possible data corruption.

For example, the daemon keeps an in-memory state of which images are in use (by containers), and which ones not; multiple daemons using those image won't keep track of that (an image may be in use by another daemon), and remove the image while it's in use.

Docker also stores various other files in /var/lib/docker, such as a key/value store for user-defined networks, which is not designed to be accessed concurrently by multiple daemons.



来源:https://stackoverflow.com/questions/36212928/implications-of-exposing-var-lib-docker-over-nfs-to-serve-hosts-with-limited-me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!