16

My app is running inside a docker image (My development team never install software in their machines, only the docker images have the dependencies).

I Need to debug something using pycharm debugger, how do I connect pycharm's debugger to the docker image's python?

Cœur
  • 37,241
  • 25
  • 195
  • 267
silva96
  • 605
  • 2
  • 5
  • 15

1 Answers1

12

One possible method is to treat your Docker container as a remote host and use remote debugging: https://www.jetbrains.com/pycharm/help/remote-debugging.html

Gigablah
  • 1,361
  • 15
  • 9
  • Do you know how to successfully enable ssh server inside my docker image in order to remote debug it? – silva96 Apr 15 '15 at 18:25
  • 1
    You'll need to install sshd. Maybe you can convince your team to update the docker image with sshd, or you can create your own based off the original image. You'll need to be running both your python application and your ssh server at the same time, so you might want to use supervisord or maybe a solution like [phusion-baseimage](http://phusion.github.io/baseimage-docker/#solution). – Gigablah Apr 16 '15 at 01:59
  • Please check https://stackoverflow.com/a/43541732/7619689 for an up-to-date solution. – Tunnelblick Jan 25 '22 at 01:59