1

I'm trying to attach the Visual Studio Code (v1.7) debugger to a node.js app that is running inside a Docker container in host-mode.

DEBUG=* /usr/bin/node --debug-brk /home/app/node_modules/homebridge/bin/homebridge -- -U /home/data -P /home/app

Command:

docker run -it --rm --net="host" \
    --name homebridge \
    -p "51826:51826" -p "5858:5858" \
    -v `pwd`:/home/app \
    dev/homebridge

using default launch.json:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Docker: Attach to Node",
        "type": "node",
        "request": "attach",
        "port": 5858,
        "address": "localhost",
        "restart": false,
        "sourceMaps": false,
        "outFiles": [],
        "localRoot": "${workspaceRoot}",
        "remoteRoot": "/home/app"
    }
]}

Diagnose:

Docker for Mac: version: 1.12.3 (583d1b8)
OS X: version 10.12.1 (build: 16B2555)
logs: /tmp/E06B6538-E61C-41B8-81C0-90EB5A538452/20161204-214523.tar.gz
[OK]     vmnetd
[OK]     dns
[OK]     driver.amd64-linux
[OK]     virtualization VT-X
[OK]     app
[OK]     moby
[OK]     system
[OK]     moby-syslog
[OK]     db
[OK]     env
[OK]     virtualization kern.hv_support
[OK]     slirp
[OK]     osxfs
[OK]     moby-console
[OK]     logs
[OK]     docker-cli
[OK]     menubar
[OK]     disk
Failure: Could not upload diagnostic data to remote server (docker-diagnose exit code is 1)

Now, when I start the application and attach the debugger i get:

Cannot connect to runtime process (timeout after 10000 ms).

However, if I start the container without the host mode (docker run -it --rm --name ...), then it works...

Any idea ???

Chris
  • 11
  • 2
  • I'm not sure you cat actually do that. VSCode will not have access to that node process in the first place, right? – yelsayed Dec 04 '16 at 10:03

0 Answers0