I'm new to Docker and am excited about using the --volumes-from
feature but there's something I'm not understanding.
If I want to use --volumes-from
with two data-only containers, each of which exports volumes named /srv
, how to I prevent the volume paths from colliding? I can map volume names when creating a bind mount using [host-dir]:[container-dir]
; how do I do that with --volumes-from
?
So what I want would look something like this:
docker run --name=DATA1 --volume=/srv busybox true
docker run --name=DATA2 --volume=/srv busybox true
docker run -t -i -rm --volumes-from DATA1:/srv1 --volumes-from DATA2:/srv2 ubuntu bash