Created
January 17, 2018 10:26
-
-
Save jtraulle/671bb0079e78271765daa28af1a240ac to your computer and use it in GitHub Desktop.
Alpine linux wkhtml2pdf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:3.3 | |
RUN apk add --no-cache \ | |
xvfb \ | |
# Additionnal dependencies for better rendering | |
ttf-freefont \ | |
fontconfig \ | |
dbus \ | |
&& \ | |
# Install wkhtmltopdf from `testing` repository | |
apk add qt5-qtbase-dev \ | |
wkhtmltopdf \ | |
--no-cache \ | |
--repository http://dl-3.alpinelinux.org/alpine/edge/testing/ \ | |
--allow-untrusted \ | |
&& \ | |
# Wrapper for xvfb | |
mv /usr/bin/wkhtmltopdf /usr/bin/wkhtmltopdf-origin && \ | |
echo $'#!/usr/bin/env sh\n\ | |
Xvfb :0 -screen 0 1024x768x24 -ac +extension GLX +render -noreset & \n\ | |
DISPLAY=:0.0 wkhtmltopdf-origin $@ \n\ | |
killall Xvfb\ | |
' > /usr/bin/wkhtmltopdf && \ | |
chmod +x /usr/bin/wkhtmltopdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment