pereiren / dotnet-template-onion

Onion Architecture with .NET 6/.NET Core and CQRS/Event Sourcing following a DDD approach

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docker build fails

javierlinked opened this issue · comments

Upon run
docker build -f Dockerfile ..

process fails because wrong .csproj file is referenced.

Step 1/17 : FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
 ---> c3a51e51a0f9
Step 2/17 : WORKDIR /app
 ---> Using cache
 ---> 9790ebeae196
Step 3/17 : EXPOSE 80
 ---> Using cache
 ---> 1f4abed4e62f
Step 4/17 : EXPOSE 443
 ---> Using cache
 ---> 6cc799c8153d
Step 5/17 : FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
 ---> dd6f8be8f903
Step 6/17 : WORKDIR /src
 ---> Using cache
 ---> bf4d464ea7f1
Step 7/17 : COPY ["Onion/Onion.csproj", "Onion/"]
COPY failed: file not found in build context or excluded by .dockerignore: stat Onion/Onion.csproj: file does not exist```

Hey Javier!

That COPY is a little bit different that the one provided in the Dockerfile

COPY ["Dotnet.Onion.Template/Dotnet.Onion.Template.csproj", "Dotnet.Onion.Template/"]

Did you create it using the dotnet CLI template or just a fork?

Thanks

I followed README steps, so first I executed:
dotnet new dotnet_template_onion -n Onion
inside Onion/src/Onion.API/ exists both dockerfile and Onion.API.csproj

COPY points to Dotnet.Onion.Template/Dotnet.Onion.Template.csproj, but that .csproj does not exist, but the other 4 (API, Infrastructure, Application and Domain).

Am I clear? Thanks.

Sure, I'll take a look at it! Thank you for reporting it!

Done!

Done!

@javierlinked Thank you very much!