Pavol Kutaj
1 min readSep 7, 2022

--

Thanks for the great write-up.

NOTE: It should be said that you are calling the Python Script directly, which is defined right in the Dockerfile by in the statement

ENTRYPOINT ["./entry.sh"]

...which in turns calls the Python script → and it, therefore, executes right after you run the container.

This is a different approach from scenarios outlined in https://code.visualstudio.com/docs/python/debugging where you need to set-up the calls in tasks.json and launch.json.

Your approach is 1-immediatelly-called-Python_script/app-per-container.

If you happen to be on Windows (it may be cool to include this in the GH repo README.md) - clone the linked repo and:

1. No need to use ./run_container.sh via cygwin, WSL terminal, etc. You're good to go with Docker and using a default PowerShell terminal / integrated PowerShell in VSCode, etc..

2. Before anything, change line endings in the cloned Dockerfile from CRLF → LF

3. In a cloned folder, run docker build -t temp-container .

4. Wait until the image builds

5. Once done run (backticks are newline chars in PowerShell)

▶ docker run `

>> -p 5678:5678 `

>> temp-container `

>> train

6. This starts the Python app

7. Create a debugger launch.json provided in the document

8. Set a breakpoint

9. Start a debugger → works for me (on 2022-09-07).

--

--

No responses yet