4

I am trying to start the PowerShell (x86) in Windows Docker Container from PowerShell but it won't start a new shell. I am running Docker from an AWS Windows EC2 running off the Windows_Server-2019-English-Full-ContainersLatest-2020.02.12 AMI. Do I need any specific DLLs to make this work?

I have Dockerfile which kind of looks like this:

FROM mcr.microsoft.com/windows/insider:10.0.17763.107
...
SHELL ["PowerShell", "-Command"]
...
CMD PowerShell

After the container start's up I try to start the 32-bit PowerShell using the below command but it doesn't start a new shell. I think it just errors out.

C:/Windows/SysWOW64/WindowsPowerShell/v1.0/powershell.exe

I tried to catch the ExitCode using the following commands:

$Process = Start-Process -PassThru -Wait -FilePath "C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe"
Write-Output "ExitCode = $($Process.ExitCode)"

Which outputs:

ExitCode = -1073741502

Which probably means STATUS_DLL_INIT_FAILED (What does ExitCode -1073741502 mean?)

The commands I am trying to execute in the Docker container work when I run it from the PowerShell in the EC2 host. I can verify by running [Environment]::Is64BitProcess which returns False.

—————————

This is the docker version I am running on the AWS EC2 based off of Windows_Server-2019-English-Full-Base-2020.02.12 (ami-00cb4c0d60b9476f4)

PS> docker version

Client: Docker Engine - Community
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        633a0ea
 Built:             Wed Nov 13 07:22:37 2019
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.24)
  Go version:       go1.12.12
  Git commit:       633a0ea
  Built:            Wed Nov 13 07:36:50 2019
  OS/Arch:          windows/amd64
  Experimental:     false

Another Update:

The commands actually work when I run from a different EC2 that I had created a while back based off of ami-0d4df21ffeb914d61 (Which is also Windows_Server-2019-English-Full-Base but the ami is not public anymore)

Another Update:

Looks like it was an issue with the ami. Was able to make it work with a previous version, Windows_Server-2019-English-Full-Base-2020.01.15 (ami-09f2114fecbe506e2)

hcas
  • 93
  • 7
  • Just curious, why x86 PS? – Dusty Vargas Feb 18 '20 at 00:22
  • I am not well versed in docker but if you can get Process Monitor in the container, you can try to use that to find your missing DLL. Just run procmon and keep it running while you call x86 powershell.exe. Since you're confident that a missing DLL is the problem, you can get the procmon output and look for FILE NOT FOUND results with .dll in the path. Maybe that will help. – Dusty Vargas Feb 18 '20 at 00:36
  • I have the same issue since today! I tried procmon.exe and it doesn't start up either and fails with the same error – Daniel Stephens Feb 18 '20 at 04:59

0 Answers0