Debug python code in Docker container

I have a Docker image containing python code. The image itself is provided by another team and I won’t be able to modify the image. Now, I want to run through that python code in PyCharm's debugger. Is it possible to do that? If so, can you please explain the things I need to do?


Comment actions Permalink

Please see

Not sure you'll be able to achieve that if you're not allowed to modify the image.

You might want to copy the code locally and debug it that way.

Comment actions Permalink

PyCharm will fail to debug any Docker container that has more then just one python file.

Simple repo: add one line to python file.

import anotherFile

PyCharm will throw "remote file can't be found" with three non-working options. 

Both PyCharm 2018 and 2019.


Please sign in to leave a comment.