如何使用当前主机用户运行Windows docker容器? -Docker Windows

时间:2019-07-09 12:27:01

标签: docker containers uid docker-windows windows-container

当我运行Windows docker容器时,我希望该容器使用同一主机当前用户。我希望当我在容器中执行 whoami echo %username% 时,在主机中得到相同的用户。

我尽力做到这一点; docker run -it --user castcorp\lam myImage_8.3.14:2033

但返回错误 docker: Error response from daemon: container 8ba8ad2f1215171daa70353185fcb47b387966c439de8bd50933451a99de1779 encountered an error during CreateProcess: failure in a Windows system call: The user name or password is incorrect. (0x52e)

我在那里https://github.com/moby/moby/issues/28585见过,但仍然没有解决办法。

我正在使用Docker for Windows,我的容器的映像是 FROM Windowsservercore2016lts

docker run -it --user castcorp\lam myImage_8.3.14:2033

docker: Error response from daemon: container 8ba8ad2f1215171daa70353185fcb47b387966c439de8bd50933451a99de1779 encountered an error during CreateProcess: failure in a Windows system call: The user name or password is incorrect. (0x52e)
[Event Detail:  Provider: 00000000-0000-0000-0000-000000000000] extra info: {"CommandLine":"c:\\windows\\system32\\cmd.exe","User":"castcorp\\lam","WorkingDirectory":"C:\\","Environment":{"COMPLUS_NGenProtectedProcess_FeatureEnabled":"0"},"EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[63,237]}.

我想连接到我的容器并解决守护程序的此错误响应。

0 个答案:

没有答案