I have this in my Dockerfile.
FROM microsoft/dotnet:2.1-sdk-nanoserver-1803 AS build
WORKDIR /src
...
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Write-Output 'hello from ps'
I run docker build and get to this point in my dockerfile, then I get the error message below.
Step 8/24 : RUN Write-Output 'hello' ---> Running in ea5d79c5698c container ea5d7....5cb94f67 encountered an error during CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2) onecore\vm\compute\management\orchestration\vmhostedcontainer\processmanagement.cpp(174)\vmcomputeagent.exe!00007FF738A6C00A: (caller: 00007FF738A3ECEA) Exception(2) tid(36c) 80070002 The system cannot find the file specified.
EDITS/UPDATES It seems that
- microsoft/aspnetcore-build does not support .net core 2.1 (but has both powershell and node installed)
- microsoft/dotnet:2.1-sdk is meant for building, but missing both powershell and node
- Same goes for microsoft/dotnet:2.1-sdk-nanoserver-1803
nanoserverimage don't have powershell by default. You can use cmd instead, as answered by yourself bellow, or use theservercoreas base image, or still install the powershell manually in your Dockerfile.