1

I'm running Docker on remote Ubuntu 16.04. My client is Windows 10 and I use PyCharm 2018.1 professional which is connected to the docker as a remote interpreter via tcp://remote_ip:port.

How can I mount remote volumes from within the PyCharm?

I tried to change the path mapping in Build, Execution, Deployment ---> Docker tab but it does not seem to work. Anyone have any advice?

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
Amit_JCI
  • 159
  • 1
  • 14
  • How did you try and mount your remote volume? Please give much more detail on what volumes you are using, which machines can see them, and what you specified that did not work. Have you considered running docker on Windows? – Stephen Rauch May 13 '18 at 14:37
  • The volumes I try to mount are just data and code folders which are on the remote host (ubuntu) machine. The volumes can be seen via pycharm remote (sftp connection). I run the code from the client but all the work and data saving are actually on the host (because of the remote pycharm). I tried also editing the 'Edit Deployment Configuration' in the docker tab but I cannot mount the host volumes via bind mounts option. Why would I want to run the docker on windows if I want to use my much more powerful host? Please ask me for more detail if needed. Thanks! – Amit_JCI May 13 '18 at 14:54
  • Can't answer why one machine over the other. Some people just are not aware that docker runs on Windows. – Stephen Rauch May 13 '18 at 15:05

1 Answers1

0

You can't. At least not directly. In order to mount volumes, the computer that runs the docker daemon needs access to those files and this cannot be done with the client alone while the container runs.

If it's a one off or you won't modify the files while the container is running, you could first make a named volume with those files by using docker cp as described in this answer.

To be able to edit you python code while the container runs, you'd need some other way to make your code accessible by the docker daemon. For example, you could share the files from your Windows computer using CIFS. Performance would be substantially impacted.

The solution to this problem is often to run the container right on your Windows computer (e.g. via Docker Desktop for Windows)

istepaniuk
  • 4,016
  • 2
  • 32
  • 60