title: Console.ReadLine inside a docker container
body: <p>I have this docker container of a console app that is supposed to get a value from user with <code>Console.Readline</code> command then continues it's job. However whenever I use a <code>Console.Readline</code> command inside myapplication and try to create image from it, I get the following exception:</p>
  
  <blockquote>
    <p>System.IO.IOException: 'The handle is invalid.'</p>
  </blockquote>
  
  <p>this is my docker file:</p>
  
  <pre><code>FROM mcr.microsoft.com/dotnet/core/runtime:3.1-nanoserver-1903 AS base
  WORKDIR /app
  
  FROM mcr.microsoft.com/dotnet/core/sdk:3.1-nanoserver-1903 AS build
  WORKDIR /src
  COPY ["DockerSample/DockerSample.csproj", "DockerSample/"]
  RUN dotnet restore "DockerSample/DockerSample.csproj"
  COPY . .
  WORKDIR "/src/DockerSample"
  RUN dotnet build "DockerSample.csproj" -c Release -o /app/build
  
  FROM build AS publish
  RUN dotnet publish "DockerSample.csproj" -c Release -o /app/publish
  
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app/publish .
  ENTRYPOINT ["dotnet", "DockerSample.dll"]
  </code></pre>
  
  <p>this is my code in console application:</p>
  
  <pre><code>class Program
      {
          static void Main(string[] args)
          {
              Console.WriteLine("Hello World!");
  
              var input=Console.ReadLine();
             //do something with my input
          }
  
      }
  </code></pre>