1
votes

I need to get the process id of a dotnet application running in a windows container in order to attach a debugger to it, but when I try to list the processess, I get an empty list.

PS > docker exec -it --privileged elated_swartz powershell -Command Get-CimInstance Win32_Process | Select-Object ProcessId, CommandLine

ProcessId CommandLine
--------- -----------

PSVersion 5.1.15063.483

Docker Client: Version: 17.06.0-ce API version: 1.30 Go version: go1.8.3 Git commit: 02c1d87 Built: Fri Jun 23 21:30:30 2017 OS/Arch: windows/amd64

Docker Server: Version: 17.06.0-ce API version: 1.30 (minimum version 1.24) Go version: go1.8.3 Git commit: 02c1d87 Built: Fri Jun 23 22:19:00 2017 OS/Arch: windows/amd64 Experimental: true

1

1 Answers

0
votes

In *nix:

docker top <container>

In Windows Using CMD:

docker exec <container> tasklist

Using Powershell:

docker exec <container> powershell get-process