7

When I'm running a windows docker container, I want that this container use the same host current user. I want that when I do whoami or echo %username% in the container, I get the same user then in the host.

I'm try to do like this:

docker run -it --user domain\username myImage_8.3.14:2033

but it return error:

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)

I have seen by there https://github.com/moby/moby/issues/28585 but still no solution.

I'm using Docker for Windows, and the image of my containers is FROM Windowsservercore2016lts

docker run -it --user domain\username 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":"domain\\username","WorkingDirectory":"C:\\","Environment":{"COMPLUS_NGenProtectedProcess_FeatureEnabled":"0"},"EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[63,237]}.

I want to connect to my container and resolve this Error response from daemon.

veben
  • 19,637
  • 14
  • 60
  • 80
Amlys
  • 125
  • 1
  • 7
  • You will have to create that user in the image. The running container does not have access to the host's user accounts, that would be quite a security risk, don't you think? – derpirscher Apr 05 '21 at 15:31

0 Answers0