2017-07-13 25 views
1

我需要獲取在Windows容器中運行的dotnet應用程序的進程ID,以便將調試器附加到它,但是當我嘗試列出processessess時,空的清單。Docker Windows容器中的Powershell列表過程生成空列表

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

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

PSVersion 5.1.15063.483

泊塢窗客戶: 版本:17.06.0-CE API版本:1.30 轉到版本:go1.8.3 git的承諾:02c1d87 內置:週五21年6月23日:30:30 2017年 OS /拱門:窗口/ AMD64

泊塢服務器: 版本:17.06.0-CE API版本:1.30(最低版本1.24) 轉到版本錫永:go1.8.3 git的承諾:02c1d87 內置:週五06月23日22時十九分00秒2017年 OS /拱門:窗口/ AMD64 實驗:真

回答

0

在* nix中:

docker top <container> 

在視窗 使用CMD:

docker exec <container> tasklist 

使用PowerShell:

docker exec <container> powershell get-process