Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 无法执行Docker exec*ID*-it命令_Powershell_Docker_Windows Container - Fatal编程技术网

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

Powershell 无法执行Docker exec*ID*-it命令,powershell,docker,windows-container,Powershell,Docker,Windows Container,我正在尝试学习如何使用docker执行装载/卷 我尝试了以下命令 docker run-it-v C:\temp:C:\temp--name“test”mcr.microsoft.com/windows/servercore:ltsc2019 容器已生成并运行。但是,当我执行docker container exec 58df-it powershell时,我遇到了以下错误 >container 58df300280ec39b4bbf1457cc9a44f60c523f91aa8d777a

我正在尝试学习如何使用docker执行装载/卷

我尝试了以下命令
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弄坏了

我试过:

  • 工厂重置docker安装

  • 使用kitematic添加环境变量,查看是否可以链接回PowerShell命令。


  • 但它已经不起作用了。如果遇到过类似情况的人有任何意见,我将不胜感激。

    在我这方面,这是一个愚蠢的错误。我设法找出了问题所在。一直以来,我都在Visual Studio代码中使用PowerShell来执行docker命令,但我不知道为什么要使用PowerShell ISE以交互模式执行。 根据这个链接
    这是PowerShell ISE上的一个已知问题,我使用PowerShell进行了尝试,现在工作正常

    @adii我也遇到了这一行,但是,因为我提到了在我尝试装载/驱动之前使用的相同命令,因此,我认为这与语法问题无关。