title: VSTS unable to build a docker image
body: <p>I have a simple out of the box VS2017 web api that I am trying to build a Docker Image for on VSTS and publish the image to Azure container registry. But its not working, error below:</p>
  
  <pre><code>2018-05-21T16:49:45.8481201Z Step 7/17 : COPY WebApi/WebApi.csproj WebApi/
  2018-05-21T16:49:45.8503445Z COPY failed: stat /var/lib/docker/tmp/docker-builder936381234/WebApi/WebApi.csproj: no such file or directory
  2018-05-21T16:49:45.8644972Z ##[error]COPY failed: stat /var/lib/docker/tmp/docker-builder936381234/WebApi/WebApi.csproj: no such file or directory
  2018-05-21T16:49:45.8732546Z ##[error]/usr/local/bin/docker failed with return code: 1
  </code></pre>
  
  <p>Its a standard VS2017 solution. </p>
  
  <p>Dockerfile</p>
  
  <pre><code>FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
  WORKDIR /app
  EXPOSE 63537
  EXPOSE 44369
  
  FROM microsoft/dotnet:2.1-sdk AS build
  WORKDIR /src
  COPY WebApi/WebApi.csproj WebApi/
  RUN dotnet restore WebApi/WebApi.csproj
  COPY . .
  WORKDIR /src/WebApi
  RUN dotnet build WebApi.csproj -c Release -o /app
  
  FROM build AS publish
  RUN dotnet publish WebApi.csproj -c Release -o /app
  
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app .
  ENTRYPOINT ["dotnet", "WebApi.dll"]
  </code></pre>
  
  <p>.dockerignore</p>
  
  <pre><code>.dockerignore
  .env
  .git
  .gitignore
  .vs
  .vscode
  docker-compose.yml
  docker-compose.*.yml
  */bin
  */obj
  </code></pre>
  
  <p>docker-compose.yml</p>
  
  <pre><code>version: '3.4'
  
  services:
    webapi:
      image: webapi
      build:
        context: .
        dockerfile: WebApi/Dockerfile
  </code></pre>
  
  <p>I have tried all the suggested solutions by changing the .dockerignore file, deleting it etc etc.</p>