无法执行 Docker exec *ID* -it 命令

Unable to perform Docker exec *ID* -it command

我正在尝试学习如何使用 docker 执行 mount/volume。

我尝试了以下命令
docker run -it -v C:\temp:C:\temp --name "test" mcr.microsoft.com/windows/servercore:ltsc2019

容器已构建 运行。但是,当我执行 docker container exec 58df -it powershell

时出现以下错误
>container 58df300280ec39b4bbf1457cc9a44f60c523f91aa8d777a1ea53f8817d3c972a encountered an error during >CreateProcess: failure in a Windows system call: 
>The system cannot find the file specified. (0x2)
>[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
>[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000]
>[Event Detail: >onecore\vm\compute\management\orchestration\vmhostedcontainer\processmanagement.cpp(173)\vmcomputeagent>.exe!00007FF60B4BB397: (caller: 00
>007FF60B46E70B) Exception(3) tid(5e4) 80070002 The system cannot find the file specified.
>    CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess] 
>Provider: 00000000-0000-0000-0000-000000000000] extra info: {"CommandLine":"-it >powershell","User":"ContainerUser","WorkingDirectory":"/","Environment":>>>>{"powershell":"C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe"},"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,
"ConsoleSize":[0,0]}`

最糟糕的是,命令 docker container exec 58df -it powershell 通常会起作用,并允许我在不使用 volume 和 mount 命令的情况下进入其他容器的交互模式。自从我 运行 这个 mount/volume 命令以来,我似乎打破了我的 docker。

我试过了:

  1. 恢复出厂设置docker安装

  2. 使用kitematic添加环境变量,看看能不能link返回PowerShell命令。

但它不再起作用了。如果有任何遇到过类似问题的人提供任何意见,我们将不胜感激。

我这边犯了一个愚蠢的错误。我设法找出问题所在。虽然我一直在 Visual Studio 代码中使用 PowerShell 来执行我的 docker 命令,但我不知道为什么我要使用 PowerShell ISE 执行进入交互模式。 据此 link PowerShell ISE issue 这是 PowerShell ISE 上的一个已知问题,我用 PowerShell 尝试过它,现在工作正常。

是的。 power shell ISE 不工作但是 windows power shell(x86) 可以