'Rotativa is not working on linux server using docker image
I'm trying to use Rotativa to generate PDF.It's is working fine on my window machine but not on ubuntu linux server.
I have created Rotativa folder under wwwroot which includes
- help-wkhtmltoimage.txt
- help-wkhtmltopdf.txt
- wkhtmltoimage.exe
- wkhtmltopdfl.exe
This is my docker file
# Set build image
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build-env
# Set working directory
WORKDIR /app
COPY PDFGenerator/*.csproj ./PDFGenerator/
# Restore the dependencies and tools of a project
RUN dotnet restore PDFGenerator/
COPY . .
# Publishes the application and its dependencies using Release configuration to /app/out
RUN dotnet publish PDFGenerator--configuration Release --output /app/out
# Set base image
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim
# Set working directory
WORKDIR /app
# Listen on port 80 at runtime
EXPOSE 80
# Copy project
COPY --from=build-env /app/out .
# Set default startup command
CMD ["dotnet", "PDFGenerator.dll"]
And here the exception I got in the server
No such file or directory, Inner Exception , StackTrace at
System.Diagnostics.Process.ForkAndExecProcess(String filename, String[]
argv, String[] envp, String cwd, Boolean redirectStdin,
Boolean redirectStdout, Boolean redirectStderr,
Boolean setCredentials,
UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32&
stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
