1

I would like to share a folder from a docker container1 to a docker container2, without any persistence. Sharing this folder with the host is not necessary.

I read that there is a volume_from option that allow to do this kind of thing, but it seems that the folder shared need to have the same path in both containers and I don't understand how to use it if containers have already many volumes.

  • If the folder on the host pc is located on a ramfs/tmpfs partition, it would work with the normal --volume dir:dir and still no persistence storage on the host. – Johan Feb 16 '19 at 15:13

1 Answers1

1

A possible option :

1/ use a container0 to hold all the docker volumes for your stack

2/ spawn container1 and container2 with --volumes-from container0

=> same volume view in both containers

Chaoxiang N
  • 1,283
  • 5
  • 11