Connect Spyder to a console in a docker container

2019-08-20 19:13发布

问题:

I am using a docker on a remote AWS EC2 instance to run my code. My current workflow is to edit code on a local machine, push it to git and then log into the EC2 machine and the docker container in it, to pull the code and run it. I was wondering if I could somehow attach Spyder's console to the kernel inside the docker, in the EC2 instance.

So my sequence of log-ins are:

localhost~: ssh -XYA remote-ec2.domain.ext remote-ec2~: ssh -XYA root@localhost -p 2222 (docker)~: python runme.py

I found a tutorial to use an SSH connected kernel, but I am wondering how to tunnel through to the docker inside.

回答1:

(Spyder maintainer here) This is possible and not that hard. Please read our documentation on how to achieve it.