pyCharm docker integration docker-compose.override.yml file ALWAYS mounts local project path

Answered

I am trying to use docker-compose from my mac to a remote ubuntu machine. The path locally is /User/my-name/project folder, on the remote machine it is /home/ubuntu/project folder.

 

However, regardless of how I configure various path mappings, the docker-compose from pyCharm *Always* sets the volume on the remote host using my mac's local path. 

 

```

/usr/local/bin/docker-compose -f /Users/ge/machine_learning/berkeley-playground/learning_to_learn_from_imperfect_demonstrations/docker-compose.yml -f /Users/my-name/Library/Caches/PyCharm2018.2/tmp/docker-compose.override.55.yml up --exit-code-from main --abort-on-container-exit main

```

 

```

version: "2.3"
services:
main:
command:
- "python"
- "-u"
- "/opt/project/main.py"
environment:
PYTHONPATH: "/opt/.pycharm_helpers/pycharm_matplotlib_backend"
PYTHONUNBUFFERED: "1"
PYTHONIOENCODING: "UTF-8"
PYCHARM_HOSTED: "1"
PYCHARM_MATPLOTLIB_PORT: "49491"
stdin_open: true
volumes:
- "/Users/my-name/machine_learning/berkeley-playground/learning_to_learn_from_imperfect_demonstrations:/opt/project:rw"
volumes_from:
- "container:41ec30a0f07854fd518dd0b753d42a16f42ba545d8357af8fa25a4f9ccb57860:ro"
working_dir: "/opt/project"

```

2 comments

Same as me. I wanna know how exactly path mapping works.

There are 2 kinds of path mapping.

 

1.

In remote docker configuration(preferences - build execution deployment - docker)

Path mappings "Virtual machine path":"Local path"

 

2.

preferences - project - project interpreter

Path mappings

"Local Path":"Remote path"

 

What are these mean exactly?

 

I'm using

PyCharm 2018.3 EAP (Professional Edition)
Build #PY-183.2407.3, built on September 11, 2018
PyCharm EAP User
Expiration date: October 11, 2018
JRE: 1.8.0_152-release-1293-b10 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6

0

Hi,

Thank you for contacting PyCharm support.

In you need to set up a remote docker interpreter, then it is necessary to create a deployment configuration (https://www.jetbrains.com/help/pycharm/deploying-applications.html) and upload the project to remote server, because PyCharm won't do it automatically. Then add manually the path mappings between local and remote machines in Settings | Project | Project Interpreter

Kind regards,

Sergey

https://www.jetbrains.com

The Drive to Develop

0

Please sign in to leave a comment.