title: Docker: COPY failed: CreateFile, looking for file in strange location
body: <p>Trying to follow the tutorial found <a href="https://docs.docker.com/engine/examples/dotnetcore/#create-a-dockerfile-for-an-aspnet-core-application" rel="noreferrer">here</a>, but running into problems.</p>
  
  <p>I run the following command from my project dir:</p>
  
  <pre><code>docker build -t my.solution .
  </code></pre>
  
  <p>I get the following:</p>
  
  <pre><code>Sending build context to Docker daemon  111.6kB
  Step 1/17 : FROM microsoft/aspnetcore:2.0-nanoserver-1709 AS base
   ---&gt; ccfb41c8f5b5
  Step 2/17 : WORKDIR /app
   ---&gt; Using cache
   ---&gt; e29a68e16001
  Step 3/17 : EXPOSE 80
   ---&gt; Using cache
   ---&gt; 976388139964
  Step 4/17 : FROM microsoft/aspnetcore-build:2.0-nanoserver-1709 AS build
   ---&gt; d7ab4e860769
  Step 5/17 : WORKDIR /src
   ---&gt; Using cache
   ---&gt; 4ab01220723e
  Step 6/17 : COPY my.solution.sln ./
  COPY failed: CreateFile \\?\C:\ProgramData\Docker\tmp\docker-builder564035917\my.solution.sln: The system cannot find the file specified.
  </code></pre>
  
  <p>I don't know why it's trying to find the file in the location it's looking for it.  Can anyone help me?  Is there a config setting I need to make?  My Docker file looks like this:</p>
  
  <pre><code>FROM microsoft/aspnetcore:2.0-nanoserver-1709 AS base
  WORKDIR /app
  EXPOSE 80
  
  FROM microsoft/aspnetcore-build:2.0-nanoserver-1709 AS build
  WORKDIR /src
  COPY my.solution.sln ./
  COPY my.solution/my.solution.csproj my.solution/
  RUN dotnet restore -nowarn:msb3202,nu1503
  COPY . .
  WORKDIR /src/my.solution
  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", "my.solution.dll"]
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Per @AlexGera's answer, I tried changing my docker file to:</p>
  
  <pre><code>FROM microsoft/aspnetcore:2.0-nanoserver-1709 AS base
  WORKDIR /app
  EXPOSE 80
  
  FROM microsoft/aspnetcore-build:2.0-nanoserver-1709 AS build
  WORKDIR /src
  VOLUME C:/tmp
  COPY my.solution.sln c:/tmp/
  COPY my.solution/my.solution.csproj my.solution/
  RUN dotnet restore -nowarn:msb3202,nu1503
  COPY . .
  WORKDIR /src/my.solution
  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", "my.solution.dll"]
  </code></pre>
  
  <p>but the error message doesn't change significantly:</p>
  
  <pre><code>docker build -t my.solution .
  Sending build context to Docker daemon  111.6kB
  Step 1/18 : FROM microsoft/aspnetcore:2.0-nanoserver-1709 AS base
   ---&gt; ccfb41c8f5b5
  Step 2/18 : WORKDIR /app
   ---&gt; Using cache
   ---&gt; e29a68e16001
  Step 3/18 : EXPOSE 80
   ---&gt; Using cache
   ---&gt; 976388139964
  Step 4/18 : FROM microsoft/aspnetcore-build:2.0-nanoserver-1709 AS build
   ---&gt; d7ab4e860769
  Step 5/18 : WORKDIR /src
  Removing intermediate container 31e30e2346aa
   ---&gt; 61c7df20f3c4
  Step 6/18 : VOLUME C:/tmp
   ---&gt; Running in fada6c728151
  Removing intermediate container fada6c728151
   ---&gt; 7a650440cc1f
  Step 7/18 : COPY my.solution.sln c:/tmp/
  COPY failed: CreateFile \\?\C:\ProgramData\Docker\tmp\docker-builder832533802\my.solution.sln: The system cannot find the file specified.
  </code></pre>