Reputation: 742
I have following configuration:
/home/apps/
.-v /home/apps:/apps -v /var/run/docker.sock:/var/run/docker.sock
, now it has apps in /apps
.-v /apps/foo:/foo
, one specific app in /foo
.Container-A runs Container-B using docker run
and I need /apps/foo
to be mounted to Container-B's /foo
. But it won't, /foo
is empty.
I believe it's because docker server is running somewhere else (outside of Container-A).
What are the ways of mounting /apps/foo
to Container-B?
EDIT:
Container-A is running with flags -v /apps -v /var/run/docker.sock:/var/run/docker.sock
. /apps
is not mounted from the host. How to mount /apps/foo
to Container-B in this case?
Upvotes: 0
Views: 88
Reputation: 41
That is correct.
Since you are using /var/run/docker.sock, even when you run -v /apps/foo:/foo
from Container-A, the host machine is still the one your docker server runs on.
So you can either create a volume like that: -v /home/apps/foo:/foo
(from inside Container-A) or setup a secondary docker server inside Container-A.
Upvotes: 2