New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work inside docker #53
Comments
Hi @Preetham-P This helped me #34 (comment) I'm using alpine image. My Dockerfile:
|
Your library might be placed in application directory, but it's possible that this directory is not listed in LD_LIBRARY_PATH environment variable. Try to add your directory PATH into this variable. |
I think you have missed out few packages. This worked for me. FROM alpine:3.7 RUN apk add --no-cache curl RUN apk add libgdiplus RUN apk add xvfb |
I also resolved this issue within a container; Here's the relevant part of my dockerfile:
And I also transfered the
|
@bchhun Hi, Im always getting "An error occurred whilte attempting to build Docker image." |
Footers don't work on the current version of wkhtmltopdf doesn't work on alpine. We needed to use surnet's version (https://github.com/Surnet/docker-wkhtmltopdf):
|
I fixed mine by using this.
/app is where your app running. |
Not working on Alpine 3.9 from Asp.Net Core runtime. |
This solved it. Thanks |
Recently we faced the same issue in our application while moving from windows based AWS EC2 instances to containerized application using Alpine Linux. However, after going through all the packages referenced in above comments and all the good suggestions given, we noticed one difference. Initially we were using Alpine Linux version 3.12 where as these solutions used Alpine Linux version 3.7. We have not tried with any other version of Alpine but downgraded (3.7) version worked for us. In addition, once this was resolved our generated PDF showed incorrect formatting for Double.ToString("C0") gave ¤ character instead of $. Which pointed us to issues with culture info settings on Alpine Linux with dotnet. Alpine Linux has no cultures installed and .Net Core 2.0 introduced a Globalization Invariant Mode, which when enabled, makes all cultures behave like invariant culture. On Alpine Linux, as the package for culture info is not installed, the Globalization Invariant mode is set to false. So to fix this, we had to install the required packages for culture info, disable globalization invariant environment variable -
Additionally, in our start-up class we specified our default culture as below -
Reference Articles - |
https://github.com/Surnet/docker-wkhtmltopdf This works to me with latest alpine image mcr.microsoft.com/dotnet/aspnet:5.0-alpine
|
Thank you, it worked in my project! |
Working for me.. 14/07/2022 |
Not Working for me 25/1/2024 So sad |
Hi,
I would appreciate if the above same code is once tested in docker and if it works pls upload the steps. I get unable to shared library every time.
"One or more errors occurred. (Unable to load shared library 'libwkhtmltox' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibwkhtmltox: cannot open shared object file: No such file or directory)"
but the libraries exist at the current directory.
The text was updated successfully, but these errors were encountered: