Skip to content

Instantly share code, notes, and snippets.

@NTICompass
Created January 27, 2016 22:10
Show Gist options
  • Save NTICompass/614e6e40d32655c64b74 to your computer and use it in GitHub Desktop.
Save NTICompass/614e6e40d32655c64b74 to your computer and use it in GitHub Desktop.
Run headless wkhtmltopdf inside Docker container
# wkhtmltopdf from: http://wkhtmltopdf.org/downloads.html
FROM centos:7
MAINTAINER Eric Siegel <nticompass@gmail.com>
# Upgrade packages & repo
RUN yum -y update
# wkhtmltopdf's dependencies
RUN yum -y install zlib fontconfig freetype libX11 libXext libXrender
# Download x64 static build of wkhtmltox (with patched QT)
ADD http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz /tmp/wkhtmltox.tar.xz
# Extract the archive
RUN tar -C /opt -xvf /tmp/wkhtmltox.tar.xz
# Run wkhtmltopdf and accept command line args
WORKDIR /opt/wkhtmltox/bin
ENTRYPOINT ["./wkhtmltopdf"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment