PyCharm with Docker image returns “Process finished with exit code 128” on RUN command
I'm trying to complete this very basic tutorial. It's a short explenation of how to run Docker image as remote interpreter in PyCharm.
I'm using Win7 and latest PyCharm version.
First I had problems with the paths but after playing with them for a bit now they looks like this:
- Environment variables: DJANGO_SETTINGS_MODULE(djangotestone.settings)
& PYTHONUNBUFFERED(1)
- Working Directory:
\C\Users\Passanova\PycharmProjects\djangotestone\djangotestone
- Path Mappings:
/C/Users/Passanova/PycharmProjects/djangotestone=/opt/project
- Docker container settings: -v
/C/Users/Passanova/PycharmProjects/djangotestone:/opt/project
So now when I atempt RUN comannd I get the following return:
1f52b930ec0f:python -u C:/Users/Passanova/PycharmProjects/djangotestone/manage.py runserver 8000
Process finished with exit code 128
The server does not start and I'm not able to verify the container by `docker ps -l`. Every time I press RUN button new container is created as expected but it never do the job and I'm never able to verify it.
In return I can `docker run -it <img> /bin/bash` and `$python --help` is OK.
In the terminal `docker run minimum/docker-django-mysite python --help` is good as well.
This is my debug result:
ad0418d30d5a:python -u /opt/.pycharm_helpers/pydev/pydevd.py --multiproc --qt-support --save-threading --save-asyncio --client 10.0.2.2 --port 19383 --file C:/Users/Passanova/PycharmProjects/djangotestone/manage.py runserver 8000
Process finished with exit code 128
I even try to change the image whit Django:latest - no effect.
I'm not sure what the `-u` option means but I noticed it is not presented when RUNing with local interpreter.
There is one more thing. It looks like after modifying the pats I escaped most of the path errors. However under Python Console I still have:
Error:{"message":"The working directory 'C:/Users/Passanova/PycharmProjects/djangotestone' is invalid. It needs to be an absolute path"}
Any help appriciated
Please sign in to leave a comment.
Hi!
This is an issue https://youtrack.jetbrains.com/issue/PY-21022 that corresponds to this problem and a workaround described in its comment https://youtrack.jetbrains.com/issue/PY-21022#comment=27-1734751:
> As a workaround please add corresponding Path mappings in the Run configuration from your project directory to the container path you have specified in Volume bindings list of Docker container settings.
Please check whether the workaround helps. The fix of the issue will be included in the PyCharm 2016.3.1.