FROM alpine:3.4
MAINTAINER Tao Wang <[email protected]>
ENV WKHTMLTOPDF_VERSION=0.12.3
RUN set -xe \
&& apk add --no-cache \
xvfb \
# Additionnal dependencies for better rendering
ttf-freefont \
fontconfig \
dbus \
# Install wkhtmltopdf from `testing` repository
&& apk add qt5-qtbase \
wkhtmltopdf \
--no-cache \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \
--allow-untrusted \
# Wrapper for xvfb
&& mv /usr/bin/wkhtmltopdf /usr/bin/wkhtmltopdf-origin
COPY ./wkhtmltopdf /usr/bin/wkhtmltopdf
ENTRYPOINT [ "wkhtmltopdf" ]
$ docker run -it -v $(pwd)/pdf:/pdf twang2218/wkhtmltopdf https//www.google.com /pdf/google.com.pdf
libEGL warning: DRI2: failed to open swrast (search paths /usr/lib/xorg/modules/dri)
libEGL warning: DRI2: failed to open swrast (search paths /usr/lib/xorg/modules/dri)
Loading page (1/2)
Printing pages (2/2)
Done
Content type
Image
Digest
Size
62.7 MB
Last updated
about 10 years ago
docker pull twang2218/wkhtmltopdf