Docker Community Forums

Share and learn in the Docker community.

Mapping a volume using a remote docker context

I’ve created a docker context to use a remote docker daemon:

docker context create --host="tcp://x.x.x.x:2375

When I try to run a docker using this context, the -v flag will create a mapping between the docker and the remote host rather than my own machine, from which I ran the command.

Is it possible to have the remote docker map volumes to my own machine? If so, is it possible to map volumes from both my machine and the remote host?

I am afraid this is not feasable… The docker client does only talk to the rest-api of the target docker engine to control it. It does not send or synchronizes files/filesystems.

Though, a feasable solution that commes close to what you want is to use cifs/nfs remote shares. Mount the remote share on your computer to add/modify/delete files and folders. Create a named volume using the remote share and use it with your container. Of course the shares need to be accessible from both machines.