I’m running a “microsoft/windowsservercore” Docker container on Windows 2016.
I need to run some commands inside the Docker container as a specific local user (db2admin), but when I run “docker exec -it container_name powershell”, the default user appears to be “containeradministrator”.
I tried using:
docker exec -u db2admin -it container_name powershell
I got the following error:
container d305a0c16f27dc24266a23f0a4e841425c941a7b26ca5672814483076d306744 encountered an error during CreateProcess: failure in a Windows system call: The user
name or password is incorrect. (0x52e) extra info: {“ApplicationName”:"",“CommandLine”:“powershell”,“User”:“db2admin”,“WorkingDirectory”:“C:\”,“Environment”:{},“EmulateConsole”:true,“CreateStdInPipe”:true,“CreateStdOutPipe”:true,“CreateStdErrPipe”:false,“ConsoleSize”:[0,0]}
Inside the container, I tried using the command :
runas /user:db2admin
but that did not work either.
Any suggestions for how to run a command as a specific local user inside the the Windows Docker container?
Thanks!