title: Starting container process caused: exec: "powershell": executable file not found in $PATH: unknown
body: <p>I'm trying to containerize my .net core 3.1 service into linux Docker container. This service works with a SQL Server database, so I have a <code>docker-compose</code> as follows:</p>
  <pre><code>version: &quot;3.5&quot;
  
  services:
      back:
          build: 
              context: ../../
              dockerfile: local_deploy/back/docker
          container_name: api
          restart: always
          environment:
            - ASPNETCORE_ENVIRONMENT=Development
          depends_on:
            - db-server
          ports:
            - &quot;7000:80&quot;
          networks:
            - localdev
  
      db-server:
          image: microsoft/mssql-server-linux:2017-latest
          container_name: db-server
          environment:
            - ACCEPT_EULA=Y
            - MSSQL_SA_PASSWORD=1234
            - MSSQL_TCP_PORT=1433
          ports:
            - &quot;1400:1433&quot;
          networks:
            - localdev
  
  networks:
    localdev:
      name: localdev
  </code></pre>
  <p>To run this <code>docker-compose</code> I have a <code>up.bat</code> file into <code>local_deploy/back</code> directory inside the root folder of the solution:</p>
  <pre><code>@echo off
  
  echo Starting build
  rd ..\..\out /s /Q
  dotnet restore ../../MySimpleService.sln -s http://nexus.tools.example.com/nuget-v2/ -s https://nexus.eas.example.com/repository/nuget-hosted/
  dotnet publish ../../MySimpleService.sln -c Release --force -o ../../out - /property:Version=1.0.0 /p:ASPNETCORE_ENVIRONMENT=Development
  
  echo Starting containers
  docker-compose up --build -d
  </code></pre>
  <p>And, finally, here is a <code>docker</code> file:</p>
  <pre><code>FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
  COPY out ./
  ENTRYPOINT [&quot;dotnet&quot;, &quot;MySimpleService.dll&quot;]
  </code></pre>
  <p>All these three files are into <code>local_deploy/back</code> directory.</p>
  <p>When I run <code>up</code> command in <code>cmd</code>, container is successfully built.</p>
  <p>The problem is that the service also uses NATS as a message broker so it is down inside of a container because it can't establish connection with NATS.</p>
  <p>To install and use NATS on my local machine I have to install a msi file prepared by our team. After installing this msi on my machine, I can run <code>MySimpleService</code> successfully locally.</p>
  <p>So, my guess, to run this service into container I should also install this msi into container. I tried to edit my <code>docker</code> file:</p>
  <pre><code>FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
  
  SHELL [&quot;powershell&quot;, &quot;-Command&quot;, &quot;$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';&quot;]
  
  COPY out ./
  
  RUN (New-Object System.Net.WebClient).DownloadFile('https://nexus.eas.example.com/repository/mars-nats-streaming-business/NatsStreaming_2.1.4-alpha386.msi', 'c:\tools\NatsStreaming_2.1.4-alpha386.msi') ;\
      Start-Process 'msiexec' -ArgumentList '/i c:\tools\NatsStreaming_2.1.4-alpha386.msi /quiet /qn /norestart /log c:\tools\installNatsStreaming.log'; \
      Start-Sleep -s 30 ;\
      Remove-Item c:\tools\*.msi -force
  
  ENTRYPOINT [&quot;dotnet&quot;, &quot;MySimpleService.dll&quot;]
  </code></pre>
  <p>But I get an error:</p>
  <blockquote>
  <p>Service 'back' failed to build : OCI runtime create failed:<br />
  container_linux.go:370: starting container process caused: exec:<br />
  &quot;powershell&quot;: executable file not found in $PATH: unknown</p>
  </blockquote>
  <p>Now my guess is that I should install a powershell into container.</p>
  <p>Any help would be highly appreciated.</p>