"dotnet build" builds a project with no errors, and at the same time docker build gives following error:
/src/Audit.Worker/Example/Resources.resx : error MSB3103: Invalid Resx file. System.IO.DirectoryNotFoundException: Could not find a part of the path '/src/Audit.Worker/Example/data/example.yaml'. [/src/Audit.Worker/Audit.Worker.csproj]
Dockerfile
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["./Audit.Worker/Audit.Worker.csproj", "Audit.Worker/"]
RUN dotnet restore "Audit.Worker/Audit.Worker.csproj"
COPY . /src/
WORKDIR "/src/Audit.Worker/"
RUN dotnet build "Audit.Worker.csproj" -c Release -o /apps
FROM build AS publish
RUN dotnet publish "Audit.Worker.csproj" -c Release -o /apps
FROM base AS final
WORKDIR /apps
COPY --from=publish /apps .
ENTRYPOINT ["dotnet", "Audit.Worker.dll"]