Skip to content

Can't attach to node in Docker #36192

@chrisdias

Description

@chrisdias

git clone https://github.com/glimpse/stickerapp
cd stickerapp
git fetch
git checkout chrisdias/connect2017
npm install && code-insiders .

tasks.json:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "taskName": "docker-compose",
            "command": "docker-compose",
            "args": [
                "-f",
                "docker-compose.debug.yml",
                "up"
            ],
            "identifier": "docker-compose"
        }
    ]
}

launch.json configuration:

        {
            "type": "node",
            "request": "attach",
            "name": "Docker",
            "address": "localhost",
            "port": 9229,
            "localRoot": "${workspaceFolder}",
            "remoteRoot": "/usr/src/app",
            "preLaunchTask": "docker-compose"
        }

press F5

result: docker-compose is run, but the debugger never attaches

add the detached flag to docker-compose in tasks.json:

        "args": [
            "-f",
            "docker-compose.debug.yml",
            "up",
            "-d"
        ],

F5

Result: "Cannot connect to runtime process...."

If you run docker-compose -f docker-compose.debug.yml -d from the terminal and then attach the debugger (without the preLauncTask) then I can attach the debugger.

Metadata

Metadata

Assignees

Labels

debugDebug viewlet, configurations, breakpoints, adapter issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions