为了将调试器附加到Windows容器中,我需要获取在Windows容器中运行的dotnet应用程序的进程ID,但是当我尝试列出进程时,我得到一个空列表。
PS > docker exec -it --privileged elated_swartz powershell -Command Get-CimInstance Win32_Process | Select-Object ProcessId, CommandLine
ProcessId CommandLine
--------- -----------
PS版本5.1.15063.483
Docker客户端:
版本:17.06.0-ce
API版本:1.30
Go版本:go1.8.3
Git提交:02c1d87
建成:2017年6月23日星期五21:30:30
操作系统/ Arch:Windows / amd64
Docker服务器:
版本:17.06.0-ce
API版本:1.30(最低版本1.24)
Go版本:go1.8.3
Git提交:02c1d87
建造时间:2017年6月23日星期五22:19:00
操作系统/ Arch:Windows / amd64
实验性:真实
最佳答案
在* nix中:
docker top <container>
在Windows中
使用CMD:
docker exec <container> tasklist
使用Powershell:
docker exec <container> powershell get-process
关于windows - Docker Windows容器中的Powershell列表过程产生空列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45092623/