This is the entire docker file. I did find out that for some reason using CMD dotnet Server.dll
made it so my program did not have access to the environment variables set in the docker file. If I set the environment variables in C#, just before running a report, everything worked fine. However, when I changded CMD dotnet Server.dll
to ENTRYPOINT ["dotnet", "Server.dll"]
I was able to run reports as expected.
Posts made by RaptorGandalf
-
RE: Cant launch chrome in docker linux container
-
Cant launch chrome in docker linux container
I have an asp.net core application that I am deploying in a linux docker container. I seem to be having trouble getting chrome to launch when I run a report. I am getting the error:
Failed to launch chrome! Running as root without --no-sandbox is not supported.
I have followed the directions on the .net local reporting page here (https://jsreport.net/learn/dotnet-local) and made the neccesarry modifications for running chrome in linux, but I am still getting the error.
Here is my full docker file:
#use the .net core 2.1 runtime default image FROM microsoft/dotnet:2.1-aspnetcore-runtime #set the working directory to the server WORKDIR /server #copy all contents in the current directory to the container server directory COPY . /server #install node RUN apt-get update -yq \ && apt-get install curl gnupg -yq \ && curl -sL https://deb.nodesource.com/setup_8.x | bash \ && apt-get install nodejs -yq #install jsreport-cli RUN npm install jsreport-cli -g #install chrome for jsreport linux RUN apt-get update && \ apt-get install -y gnupg libgconf-2-4 wget && \ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \ apt-get update && \ apt-get install -y google-chrome-unstable --no-install-recommends ENV chrome:launchOptions:args --no-sandbox #expose port 80 EXPOSE 80 CMD dotnet Server.dll
Is there another step that I am missing somewhere? Thanks in advance for any help!
-
Issues using Chrome-Pdf recipie on IIS
I am using the jsreport nuget packages in an asp.net core application. I am able to generate my pdf reports on my local machine however I run into an issue when I try to generate reports with the asp.net core application running in IIS. Whenever I attempt to run a report, it ultimately times out and gives me the following error:
Error rendering report: instance has been daemonized and initialized successfully (pid: 2480)A critical error occurred while trying to execute the render command: Timeout Error: pdf generation not completed after 40000ms
Here is what I have been able to verify so far:
-
I can navigate to the jsreport folder in the deployed asp.net core application, run "jsreport start" from the command line and enter jsreport studio. From there I can run my reports with sample data sizes comparable to what I would expect at runtime, and they export to PDF just fine.
-
I can successfully make a request to the IIS hosted asp.net core application to render a plain HTML report.
-
The reports run just fine when being hosted on my local machine, outside of IIS.
-
I have added an exception to the jsreport.exe file on the IIS machine as well, but that didnt seem to change anything.
Edit: Some additional information..
The IIS app is running under the Network Authority user. I have given the application pool full permissions to the jsreport folder deployed with the ASP.Net Core application, and to the jsreport folder in C:\Windows\Temp
Are there any additional steps I need to take to get chrome-pdf conversion working when hosting with IIS?
-