将Spyder连接到远程主机上Docker容器中的控制台 [英] Connect Spyder to a console in a docker container on a remote host
问题描述
我在远程AWS EC2实例上使用docker运行我的代码。我当前的工作流程是在本地计算机上编辑代码,将其推送到git,然后登录到EC2计算机和其中的docker容器,以提取代码并运行它。我想知道是否可以通过某种方式将Spyder的控制台连接到EC2实例中的docker内部的内核。
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.
所以我的登录顺序是:
localhost〜:ssh- XYA remote-ec2.domain.ext
remote-ec2〜:ssh -XYA root @ localhost -p 2222
(docker)〜:python runme.py
我找到了使用SSH 连接的内核,但我想知道如何通过隧道传输到内部的docker。
I found a tutorial to use an SSH connected kernel, but I am wondering how to tunnel through to the docker inside.
推荐答案
(这里是[Spyder维护者] ),这是可能的,但并不难。请阅读我们的文档有关如何实现的信息
(Spyder maintainer here) This is possible and not that hard. Please read our documentation on how to achieve it.
这篇关于将Spyder连接到远程主机上Docker容器中的控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!