简体   繁体   中英

Docker Alpine dotnet Core 2.2 Console App every response content-length 0

i´m trying to run a dotnet Core 2.2 Console Application in an Alpine .net Core Docker image.

On my windows computer the application is running - on the docker container its running too but every response is status 200 with empty content.

Container logs looks good.

This is my DockerFile:

 #FROM mcr.microsoft.com/dotnet/core/runtime:2.2-alpine as base FROM mcr.microsoft.com/dotnet/core/sdk:2.2-alpine as base WORKDIR /app EXPOSE 11007 FROM mcr.microsoft.com/dotnet/core/sdk:2.2-alpine as builder COPY . /app WORKDIR /app/Common RUN ["dotnet", "restore"] WORKDIR /app/DataAccess RUN ["dotnet", "restore"] WORKDIR /app/ERPSystem RUN ["dotnet", "restore"] WORKDIR /app/GlobalLibrary RUN ["dotnet", "restore"] WORKDIR /app/Hoster RUN ["dotnet", "restore"] WORKDIR /app/Model RUN ["dotnet", "restore"] WORKDIR /app/Service RUN ["dotnet", "restore"] WORKDIR /app/Hoster #RUN ["dotnet", "build"] RUN dotnet build -c Debug -o /result FROM builder AS publish RUN dotnet publish -c Debug -o /result FROM base AS final COPY ["settings.json", "/usr/share"] WORKDIR /app COPY --from=publish /result . ENTRYPOINT ["dotnet", "Hoster.dll"] 

the controllers are located in a other assembly (next to startup.cs in a folder "Controllers"). On linux I have to use " services.AddMvc().AddApplicationPart(typeof(somecontrollerclass).Assembly);" instead of " services.AddMvc();" (both is working on windows).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM