Visual Studio代码在将远程debugging附加到docker容器中的瓶颈应用程序期间卡住了
我目前正在从primefaces切换到Visual Studio代码 – 部分原因是debuggingfunction。
不幸的是我不能在以下设置中运行远程debugging :
networking/ app.py
from flask import Flask app = Flask(__name__) import ptvsd try: ptvsd.enable_attach(secret=None, address = ('0.0.0.0', 3000)) ptvsd.wait_for_attach() ptvsd.break_into_debugger() except: pass @app.route('/') def hello_world(): return 'Flask Dockerized' if __name__ == '__main__': app.run(debug=False,host='0.0.0.0', port=5000)
泊坞窗,compose.yml
web: build: ./web ports: - "5000:5000" - "3000:3000" volumes: - .:/code
launch.json
{ "name": "Attach (Remote Debug)", "type": "python", "request": "attach", "localRoot": "${workspaceRoot}", "remoteRoot": "${workspaceRoot}", "port": 3000, "secret": "", "host": "localhost" }
问题:当我运行docker-compose时,我得到:
starting container flaskdocker ... starting container flaskdocker ... done attaching to flaskdocker
它只是卡在那里,我不能访问端口上的烧瓶应用程序:5000(附加debugging之前完美工作)。
为什么? :/ 请帮忙!
我在使用Visual Studio Code 1.15.1的macOS上。
从Visual Studio Code使用ptvsd> 3.0.0进行远程debugging时报告了一些问题。
最经常提到的问题是VSC在试图连接到远程debugging器时“挂起”。
现在,使用ptvsd 3.0.0:
pip install ptvsd==3.0.0
- 如何debugging在docker容器内运行的rails应用程序
- 如何使用Docker for OSX Beta在PyCharm中debuggingFlask应用程序?
- 通过EclipsedebuggingDocker上的Wildfly应用程序?
- Docker容器中的Java 9 Tomcat 9无法远程debugging
- 按单点查看日志。 使用Docker群
- 使用适用于Docker的Visual Studio工具部署和debugging远程Linux Docker容器
- 从运行tomcat服务器的docker容器获取debugging信息
- 如何在使用stream浪者泊坞窗的IntelliJ思想中debuggingpython
- 如何用VS代码远程debuggingDocker容器中的Python代码