How can i fix the"preLaunchTask": "docker-run: debug" terminated with exit code 1' issue?

Viewed 164

I am working with VScode on windows.When I try to debug docker-build command, it shows an Error: The preLaunchTask 'build' terminated with exit code 1. at "preLaunchTask": "docker-run: debug" line in my launch.json file.

Here is launch.json file:

"configurations": [
        {
            "name": "Docker: Python - General",
            "type": "docker",
            "request": "launch",
            "preLaunchTask": "docker-run: debug",
            "python": {
                "pathMappings": [
                    {
                        "localRoot": "${workspaceFolder}",
                        "remoteRoot": "/app"
                    }
                ],
                "projectType": "general"
            }
        }
    ]

Here is tasks.json file:

version": "2.0.0",
    "tasks": [
        {
            "type": "docker-build",
            "label": "docker-build",
            "platform": "python",
            "dockerBuild": {
                "tag": "stocksight01b12:latest",
                "dockerfile": "${workspaceFolder}/Dockerfile",
                "context": "${workspaceFolder}",
                "pull": true
            }
        },
        {
            "type": "docker-run",
            "label": "docker-run: debug",
            "dependsOn": [
                "docker-build"
            ],
            "python": {
                "file": "sentiment.py"
            }
        }
    ]
}
0 Answers
Related