title: Docker image building error from Vidual Studio 2019
body: <p>I am trying to build a Docker image from a very simple .Net Core console program. The program tested fine locally. When I do the &quot;Build Docker Image&quot; from the docker file's right click menue, the build process started and ran for about a minute before errored out. Here is the build output with the error:</p>
  <pre><code>Rebuild started...
  1&gt;------ Rebuild All started: Project: TPA-Solution-0, Configuration: Debug Any CPU ------
  Restored C:\xxxxx\Projects\TPA Solution\Programs\TPA-Solution-0\TPA-Solution-0.csproj (in 4 ms).
  1&gt;TPA-Solution-0 -&gt; C:\xxxxx\Projects\TPA Solution\Programs\TPA-Solution-0\bin\Debug\net5.0\TPA-Solution-0.dll
  1&gt;Docker version 20.10.17, build 100c701
  1&gt;docker build -f &quot;C:\xxxxx\Projects\TPA Solution\Programs\TPA-Solution-0\Dockerfile&quot; --force-rm -t tpasolution0  --label &quot;com.microsoft.created-by=visual-studio&quot; --label &quot;com.microsoft.visual-studio.project-name=TPA-Solution-0&quot; &quot;C:\xxxxx\Projects\TPA Solution\Programs\TPA-Solution-0&quot;
  1&gt;Sending build context to Docker daemon  18.94kB
  1&gt;
  1&gt;Step 1/17 : FROM mcr.microsoft.com/dotnet/runtime:5.0 AS base
  1&gt; ---&gt; d743e8021e29
  1&gt;Step 2/17 : WORKDIR /app
  1&gt; ---&gt; Using cache
  1&gt; ---&gt; bd1091589683
  1&gt;Step 3/17 : FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
  1&gt; ---&gt; 66bfc445b338
  1&gt;Step 4/17 : WORKDIR /src
  1&gt; ---&gt; Running in a56d1b7202cb
  1&gt;Removing intermediate container a56d1b7202cb
  1&gt; ---&gt; 5c3aee56a12b
  1&gt;Step 5/17 : COPY [&quot;TPA-Solution-0.csproj&quot;, &quot;.&quot;]
  1&gt; ---&gt; e10fddcab5a8
  1&gt;Step 6/17 : RUN dotnet restore &quot;TPA-Solution-0.csproj&quot;
  1&gt; ---&gt; Running in 25290dbc7cc8
  1&gt;  Determining projects to restore...
  1&gt;C:\Program Files\dotnet\sdk\5.0.408\NuGet.targets(131,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [C:\src\TPA-Solution-0.csproj]
  1&gt;C:\Program Files\dotnet\sdk\5.0.408\NuGet.targets(131,5): error :   No such host is known. (api.nuget.org:443) [C:\src\TPA-Solution-0.csproj]
  1&gt;C:\Program Files\dotnet\sdk\5.0.408\NuGet.targets(131,5): error :   No such host is known. [C:\src\TPA-Solution-0.csproj]
  1&gt;Removing intermediate container 25290dbc7cc8
  1&gt;The command 'cmd /S /C dotnet restore &quot;TPA-Solution-0.csproj&quot;' returned a non-zero code: 1
  1&gt;C:\xxxxx\Projects\TPA Solution\Programs\TPA-Solution-0\Dockerfile : error CTC1014: Docker command failed with exit code 1.
  1&gt;C:\xxxxx\Projects\TPA Solution\Programs\TPA-Solution-0\Dockerfile : error CTC1014: The command 'cmd /S /C dotnet restore &quot;TPA-Solution-0.csproj&quot;' returned a non-zero code: 1
  1&gt;Done building project &quot;TPA-Solution-0.csproj&quot; -- FAILED.
  </code></pre>
  <p>Can someone tell me what I am doing wrong here? What should I do to fix it? I am new to the Docker thing and am still trying to understand how things work. For one thing, the output above use location &quot;[C:\src\TPA-Solution-0.csproj]&quot;. While the &quot;TPA-Solution-0.csproj&quot; is the name of my test project, that's not the right location. In fact, I don't have a C:\src in my file system.</p>
  <p>Here is my docker file that Vidual Studio generated for me:</p>
  <pre><code>FROM mcr.microsoft.com/dotnet/runtime:5.0 AS base
  WORKDIR /app
  
  FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
  WORKDIR /src
  COPY [&quot;TPA-Solution-0.csproj&quot;, &quot;.&quot;]
  RUN dotnet restore &quot;TPA-Solution-0.csproj&quot;
  COPY . .
  WORKDIR &quot;/src/&quot;
  RUN dotnet build &quot;TPA-Solution-0.csproj&quot; -c Release -o /app/build
  
  FROM build AS publish
  RUN dotnet publish &quot;TPA-Solution-0.csproj&quot; -c Release -o /app/publish
  
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app/publish .
  ENTRYPOINT [&quot;dotnet&quot;, &quot;TPA-Solution-0.dll&quot;]
  </code></pre>
  <p>As you can see, it also mention folders such as /app, /src that I don't know where they are. I don't have them in my project's folder structure, and I don't see them under C:.</p>