栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

如何使用docker-compose.debug.yml调试在docker中运行的节点?

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

如何使用docker-compose.debug.yml调试在docker中运行的节点?

您可以执行此操作,但需要进行一些修改。

launch.json

{    // Use IntelliSense to learn about possible Node.js debug attributes.    // Hover to view descriptions of existing attributes.    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387    "version": "0.2.0",    "configurations": [        { "type": "node", "request": "attach", "name": "Attach to Remote", "address": "127.0.0.1", "port": 9229, "localRoot": "${workspaceRoot}", "remoteRoot": "/usr/src/app", "preLaunchTask": "start_node_compose"        }        // {        //     "type": "node",        //     "request": "launch",        //     "name": "Launch Program",        //     "program": "${workspaceRoot}/index.js"        // }    ]}

如您所见,我评论了本地启动,并使其成为第一个启动程序,因此它可以在F5上运行。接下来,我们需要定义一个

start_node_compose
任务

task.json

{    "version": "0.1.0",    "command": "myCommand",    "isShellCommand": false,    "args": [],    "showOutput": "always",    "tasks": [        { "taskName": "start_node_compose", "showOutput": "always", "isBuildCommand": true, "command": "/bin/bash", "args": [     "-c",     "docker-compose -f docker-compose.yml -f docker-compose.debug.yml up -d && sleep 10" ]        }    ]}

Then when you run the command using F5 you will be able to hit the breakpoint



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/447512.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号