Home > Net >  .net core dockerfile in a start-up project, build the mirror can't find the reference of other
.net core dockerfile in a start-up project, build the mirror can't find the reference of other

Time:09-16

I have a question want to ask next, there are multiple projects, under the one solution (Test. The Core project, the Test. The Core project, WebApi project),
Dockerfile on the inside of the startup project WebApi,
When I build mirror tip can't find the corresponding other project

 
The FROM Microsoft/aspnetcore: 2.0 AS base
WORKDIR/app
EXPOSE 80

The FROM Microsoft/aspnetcore - build: 2.0 AS the build
WORKDIR/SRC
COPY [" Test. WebApi. Csproj ", "Test. WebApi/"]
The RUN dotnet restore "Test. WebApi/Test. The WebApi. Csproj"
COPY.
WORKDIR "/SRC"
The RUN dotnet build "Test. WebApi. Csproj" - c Release - o/app

FROM the build AS the publish
RUN dotnet publish "Test. WebApi. Csproj" - c Release - o/app

FROM the base AS final
WORKDIR/app
COPY -- from=publish/app.
ENTRYPOINT [" dotnet ", "Test. WebApi. DLL"]


  • Related