microsoft / iis-docker

Dockerfile for IIS
https://hub.docker.com/r/microsoft/iis/
MIT License
288 stars 128 forks source link

Docker build fails for ltsc2019 #187

Closed SergeyFilippov closed 5 months ago

SergeyFilippov commented 3 years ago

Environment Windows Server 2019 [10.0.17763.1999] Docker version 20.10.7, build f0df350

Docker image hash 5b60ac4e9e92 [ltsc2019 10.0.17763.1999]

Description Trying to build a dockerfile produces the following error:

The command 'cmd /S /C powershell -Command Add-WindowsFeature Web-Server; Invoke-WebRequest -UseBasicParsing -Uri "https://dotnetbinaries.blob.core.windows.net/servicemonitor/2.0.1.10/ServiceMonitor.exe" -OutFile "C:\ServiceMonitor.exe"' returned a non-zero code: 3221225781

Steps to reproduce:

  1. Clone the repository
  2. Go to "windowsservercore-ltsc2019" directory
  3. Execute docker build -t iis . command

Notes From what was able to find, it seems that trying to execute powershell is now always produces exit code 3221225781, what is usual case if there are some dependencies are missing.

Since trying to use any different image produces the results

The container operating system does not match the host operating system.

This seems like a serious issue to me.

Sudhansup commented 3 years ago

I am facing the same issue

Hassnain-Alvi commented 2 years ago

I am facing the same issue

I am having the same problem. Did anyone found a fix?

SergeyFilippov commented 2 years ago

I am having the same problem. Did anyone found a fix?

For now the best solution I've found is installing "pwsh" aka Powershell 7 into a base image (mcr.microsoft.com/windows/servercore:ltsc2019) and then using "pwsh" instead of "powershell" for all the dockerfile commands.