Comments (6)
Most likely you need to install some additional dependencies. Try to terminal into the container and temporarily install the libwkhtmltox library and see what it needs.
Here's the dockerfile I'm using for reference:
# App image (use the Debian-based based since wkhtmltopdf has dependencies that aren't readily available in Alpine)
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS final
# Install dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
zlib1g \
libgdiplus \
libc6-dev \
ca-certificates \
fontconfig \
fontconfig-config \
fonts-dejavu-core \
libbsd0 \
libexpat1 \
libfontconfig1 \
libfontenc1 \
libfreetype6 \
libjpeg62-turbo \
libpng16-16 \
libssl1.1 \
libx11-6 \
libx11-data \
libxau6 \
libxcb1 \
libxdmcp6 \
libxext6 \
libxrender1 \
ucf \
x11-common \
xfonts-75dpi \
xfonts-base \
xfonts-encodings \
xfonts-utils \
&& rm -rf /var/lib/apt/lists/*
# Builder image to run the clean up in and use as a copy base
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS builder1
WORKDIR /sln
# Copy across all source files
COPY . .
# Delete files we don't need so Docker can capture this and we can use it as a copy source later
RUN find . -type f ! \( -name "*.*proj" -o -name "*.sln" -o -name "NuGet.config" \) -delete && \
find . -depth -type d -exec rmdir {} \; 2>/dev/null
# Create a new stage based on the cleaned-up source
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS builder
WORKDIR /sln
# Install dependencies
RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg \
&& mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ \
&& wget -q https://packages.microsoft.com/config/debian/10/prod.list \
&& mv prod.list /etc/apt/sources.list.d/microsoft-prod.list \
&& chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg \
&& chown root:root /etc/apt/sources.list.d/microsoft-prod.list
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-transport-https \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
dotnet-sdk-3.1 \
&& rm -rf /var/lib/apt/lists/*
# Copy out all the project files necessary for dotnet restore from builder1
COPY --from=builder1 /sln .
RUN dotnet restore
# Copy across the files again for the full build
COPY ./test ./test
COPY ./src ./src
RUN dotnet build -c Release "./src/ServiceHostDocumentGenerator/ServiceHostDocumentGenerator.csproj"
RUN dotnet publish "./src/ServiceHostDocumentGenerator/ServiceHostDocumentGenerator.csproj" \
-c Release -o "dist" --no-restore
# App image
FROM final
WORKDIR /app
EXPOSE 80
COPY --from=builder /sln/dist .
ENTRYPOINT ["dotnet", "ServiceHostDocumentGenerator.dll"]
from wkhtmltopdf-dotnet.
It could be a dependency for libwkhtmltox. Try to install that library directly (outside .NET) and see if ti works.
from wkhtmltopdf-dotnet.
the project run in the docker how install the library
from wkhtmltopdf-dotnet.
ok thank you very much l will try it
from wkhtmltopdf-dotnet.
do you have easy way to solve it ?
from wkhtmltopdf-dotnet.
Not sure what you mean, this is common when you work with dockers, the base image may not have all the dependencies installed, so you have to add those to your Dockerfile. But I provided an example above that includes everything you need.
from wkhtmltopdf-dotnet.
Related Issues (20)
- Table of content styling HOT 2
- Exclude runtimes folder from publish HOT 2
- libwkhtmltox using produceForms html form to pdf form does not work HOT 2
- Local file access HOT 1
- Gmail is detecting pdf generated by WkHtmlToPdf-DotNet as malware HOT 1
- creating pdf with .net6 in aws lambda HOT 4
- Not able to generate report once deployed to Kubernates HOT 1
- Execution time increases under load HOT 1
- I didn't use dependency injection. Using static creation would cause the thread to get stuck and new requests to keep getting stuck HOT 22
- % in the href attribute are still encoded to %25 HOT 2
- Not reading settings on alpine HOT 2
- HTML tags removed HOT 3
- Reporting a vulnerability HOT 1
- In Linux CentOS 7, there was an error: Unable to load native library. The platform may be missing native dependencies (libjpeg62, etc). Or the current platform is not supported. HOT 3
- Memory overflow HOT 2
- The wkhtmltopdf project that is used, is no longer maintained HOT 3
- Display flex is not working HOT 1
- Unable to load native library - Windows 10/11 HOT 16
- Add ability to process pdf generation on multiple threads HOT 1
- How can I set html code with css in header HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wkhtmltopdf-dotnet.