Not able to create remote docker-composer interpreter

Answered

Hi, I'm using PyCharm 2017.1.3 Pro, macOS 10.11.6.

And I have a Docker runtime in a remote VM. There are images used for my project on it, and I can use docker-compose -f docker-compose.dev.yml up -d web to start my project if put my project code on the VM as well, docker-compose.dev.yml is part of project.

I can use docker-machine to manage it from my Mac. It's also added successfully in PyCharm, connection tested good.

Now what I want to do is, developing my project from PyCharm on my Mac and running my project via remote docker-compose.

However, when I add a remote docker-compose interpreter, it requires a docker-compose file. I put my project's docker-compose.dev.yml, but it always fails, says can't find it.

I also configured my VM as a deployment server, mapping my local project to remote dir. I don't why PyCharm can't find docker-compose file. What should I configure? Thanks.

10 comments
Comment actions Permalink

Hi xj! Could you please take a screenshot of the error message you have?

0
Comment actions Permalink

Hi Pavel, what should I choose for a configuration file when I create a new project with a remote docker-compose interpreter? Sorry, I didn't bring my laptop back.



0
Comment actions Permalink

You should pick docker-compose.yml in your case it's docker-compose.dev.yml I believe.

0
Comment actions Permalink

OK. Is that possible both Docker and source code on remote VM? I put my source code and Docker runtime on one remote VM, and I want to do remote develop via PyCharm.

0
Comment actions Permalink

BTW, I finally make remote docker-compose work. However, why source code in container doesn't sync with my local? I have set Docker to map ".:/app" in docker-compose file. 

version: '2'
services:
web:
image: mydjango
# command:
ports:
- "8080:8080"
volumes:
- .:/app
0
Comment actions Permalink

Here is the error message. The "docker-compose.yml" does exist on my Mac. 

0
Comment actions Permalink

Hello.

Any news regarding this issue?

I stumbled upon the same problem with PhpStorm and Windows 10.

I'm using "remote" docker-compose, which gets executed on a VM created with docker-machine and corresponding envs are set.

I can reproduce it with windows command with the host path (/c/Users/...), which is not shared with the guest.

Should the path mapping handle this?

I mapped the projects root (in /c/Users/...) to /export.

But docker-compose is called with the host path not /export/docker-compose-phpunit.yml.

I could probably solve this by adding /c/Users as a shared folder to the guest.

But isn't there any other way to solve it?

Thanks.

Steve

0
Comment actions Permalink

bump, i have the exact same issue, pycharm can create the folder structure on the remote host, but doesnt seem to align the files etc.


0
Comment actions Permalink

Same on Ubuntu:

```

$ lsb_release -a
LSB Version: core-9.20170808ubuntu1-noarch:printing-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

```

0
Comment actions Permalink

Hi Paulo,

This error doesn't seem to be related to the initial post, but since it's a permission error, please ensure that you launch PyCharm under user 'paulos' and that user have full access to the specified directory.

You can test by trying to create a file manually in /home/paulos/.PyChasm2018.3/system/tmp/

0

Please sign in to leave a comment.