title: ASP.NET Core Dockerfile default template: "COPY *.sln ./" No source files were specified
body: <p>I've created a standard ASP.NET core web app using the Visual Studio default template and added Docker support. This creates the following file/folder structure</p>
  
  <pre><code>+ Test01
      +Test01
          -All project files
          -Dockerfile
      -Test01.sln
      -docker-compose.xxx files
      -.dockerignore
  </code></pre>
  
  <p>The Dockerfile is created by VS as follows:</p>
  
  <pre><code>FROM microsoft/aspnetcore:2.0 AS base
  WORKDIR /app
  EXPOSE 80
  
  FROM microsoft/aspnetcore-build:2.0 AS build
  WORKDIR /src
  COPY *.sln ./
  COPY Test01/Test01.csproj Test01/
  RUN dotnet restore
  COPY . .
  WORKDIR /src/Test01
  RUN dotnet build -c Release -o /app
  
  FROM build AS publish
  RUN dotnet publish -c Release -o /app
  
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app .
  ENTRYPOINT ["dotnet", "Test01.dll"]
  </code></pre>
  
  <p>Now when I use the Docker CLI to build the image based on the Dockerfile which in the <strong>project folder</strong>:</p>
  
  <pre><code>cd -to project folder-
  docker build -t test01 . 
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Step 6/17 : COPY *.sln ./
  No source files were specified
  </code></pre>
  
  <p>Obviously this happens because the Dockerfile is in the project folder (/Test01/Test01), while the .sln file is in the parent folder (/Test01).</p>
  
  <p>I don't understand however why the default Dockerfile is setup this way? Why is the Dockerfile not in the Solution folder instead of the project folder? If you build from the CLI in this way, not only the .sln file is not accessible, but also the .dockerignore and docker-compose files are in the parent folder?</p>
  
  <p>What am I missing?</p>