0

I have a multi-process application which run overs multiple host. We want to run this app inside docker container. We are not using docker swarm for launching remote host process inside container (due to some ssh issues in docker), internally we are launching docker container before launching a remote process. All these processes share a docker image which takes more than 100GB disk size.

The problem is that we do not want this docker image to consume 100s of Gb on each host, where containers are initialized. Is there a way to share this docker workdir from local path to NFS path without any issue. I know there are options to change configuration in docker to user different path but docker manual says :

--data-root is the path where persisted data such as images, volumes, and cluster state are stored. The default value is /var/lib/docker. To avoid any conflict with other daemons, set this parameter separately for each daemon.

https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file

Also is there a way load a image(from some nfs path) in docker daemon running on a host when docker run command is issued (i.e. do not pre load the image before launching the container on each host.)

  • You can’t share /var/lib/docker for multiple hosts on an nfs drive, those files are intended to be per host (I tried, starting a second daemon fails locking the metadata.db). You can bind mount an nfs volume to a mount point inside the container that is shared however (i.e. mount your nfs drive to /mnt the run the container with -v /mnt:/my-nfs-drive). You can use docker save to tarball the image and docker load to load the tarball. – masseyb Sep 18 '19 at 05:15
  • Thanks for the answer..So you confirm that there is no way to share docker image disk space across different hosts? It will consume 100s of GB (or whatever be docker image size) on each host? It will be quite strange if docker does not have any solution for this. – user2750698 Sep 18 '19 at 07:15
  • Possible duplicate of [Implications of exposing /var/lib/docker over NFS to serve hosts with limited memory](https://stackoverflow.com/questions/36212928/implications-of-exposing-var-lib-docker-over-nfs-to-serve-hosts-with-limited-me) – masseyb Sep 18 '19 at 07:27

0 Answers0