Search code examples
dockerasp.net-coredockerfile

Docker - ASP.NET Core: Failed to build docker image in Visual studio 2019


I have an ASP.NET Core project which I want to build as docker image but it fails.

My project directory:

-myproject

--Blazor.Server

---Blazor.Server.csproj

---dockerfile

--Blazor.Shared

---Blazor.Shared.csproj

My dockerfile:

My dockerfile

When I build this dockerfile, I get the error below:

Error

I will be very thankful for any advise to solve this issue.


Solution

  • The docker engine didn't find resources through your path during building.

    You should change your project structure as follows:

    myproject
    ├─Blazor.Server
    │  └─Blazor.Server.csproj
    ├─dockerfile
    └─Blazor.Shared
       └─Blazor.Shared.csproj