local Docker debug disabled?

I can run the docker container but not debug. It starts up as expected, I can fidget around in the container with the terminal, but the debug button is greyed out.

I configured the project to connect to the Docker server via an unix socket.

Docker version is 18.09.2-6247962

 

Thanks for any help in advance!

6 comments

Please try using the regular Python run configuration instead of "Docker image". If you have docker interpreter configured correctly, it should be run in the container, and you can debug it no problem.

Please see the following for an example on how to use docker in PyCharm:

https://www.jetbrains.com/help/pycharm/using-docker-as-a-remote-interpreter.html

0

hey!

 

thanks for the answer - I wonder how do I pass run settings if I select remote interpreter. A bit of context might help: I'd like to work with AI, and it helps a lot if I allow docker to use the GPU capabilities via the nvidia docker. I also want to allow the usb devices, I set networking = host, etc. If I select the docker image for run configs, it allows me to pass such settings, however if I select the python config with a previously set remote python interpreter in my docker  I can't pass such arguments. When I set up the remote interpreter it only asks for the image, no option to add arguments to it. I imagine what happens when I press the run/debug button is that PyCharm invokes a docker run on this container without any arguments?

Any workaround for this?

Ultimately it would the best if I could start such a container from PyCharm but I can work with deploying the code in a running container.

 

Cheers,

P

0

It seems that you mean Docker container settings, which can be set using the following option:

 

However, it only allows a certain set of settings. If there's some settings you need which is missing from there, this might be a good feature request opportunity, which can be posted to our issue tracker (https://youtrack.jetbrains.com/issues/PY)

0

is there a way then to attach to a running container and deploy the code there? the problem is that the container settings you mentioned allows volume & port bindings, nothing else pretty much. using the nvidia runtime is crucial for me.

 

what is the purpose of the docker image configuration if not this?

0

in the meantime i managed to override the default docker runtime systemwide, so PyCharm starts a GPU enabled docker, but I was wondering if this is something I could achieve without editing my systemwide docker settings.

 

Cheers,

P

0

There's no good way to attach to a running container and deploy a code there, all Docker related configurations in PyCharm are running docker containers from images, deploy the code there, then stop the containers. This is how Docker is intended to be used while developing.

So, as I understand, the issue basically comes down to not being able to specify all the required docker container settings. 

Here's a ticket on network aliases: https://youtrack.jetbrains.com/issue/PY-23244

For other settings, I think it's better to submit a corresponding feature request (one per required setting, for example - ability to allow USB devices)

0

Please sign in to leave a comment.