Search code examples
dockerpowershelldocker-for-windows

Powershell not starting inside Windows Servercore Docker image


After starting a Windows docker container (base image mcr.microsoft.com/windows/servercore:ltsc2019) on a Windows Server 2019 Datacenter host i cannot start a powershell inside it.

If i create an image from a Dockerfile like this:

FROM mcr.microsoft.com/windows/servercore:ltsc2019

WORKDIR /
WORKDIR /config

ADD /config/run.ps1 /config/run.ps1

CMD ["powershell", "./run.ps1"]

And try to run with docker run -d -it my-image-name i can see the error code 3221225781 in event log.

If i run docker run -it my-image-name powershell i get the error failed to resize tty, using default size and then nothing happens.

If i run docker run -it my-image-name cmd.exe i can enter the container but running powershell inside does nothing (no error message or any output).

I tried disabling antivirus and installing VC++ redistributables on the host but no change.

The same image is working fine for other customers on Windows Server 2019 hosts (not datacenter).

Is there any solution or any additional way for me to try and debug the problem? Could the datacenter edition be a problem?


Solution

  • Finally figured out the problem: Kaspersky.

    As stated in the question i tried deactivating it but that didn't make a difference. What worked was completely uninstalling Kaspersky..