Dockerized wkhtmltopdf
# The example found at https://wkhtmltopdf.org:
docker run --rm -v $(pwd):/root icalialabs/wkhtmltopdf http://google.com google.pdf
Instead of directly basing your Dockerfile from this image, try copying instead the executable from this image. You'll need to install the dependency packages for wkhtmltopdf to work:
# 1: Start from whatever image you are using - this is a ruby app example:
FROM ruby:alpine
# 2: Install the packages required for wkhtmltopdf to work:
RUN apk add --no-cache \
libstdc++ \
libx11 \
libxrender \
libxext \
libssl1.0 \
ca-certificates \
fontconfig \
freetype \
ttf-dejavu \
ttf-droid \
ttf-freefont \
ttf-liberation \
ttf-ubuntu-font-family
# 3: Copy the wkhtmltopdf executable binary directly from our image:
COPY --from icalialabs/wkhtmltopdf:alpine /bin/wkhtmltopdf /bin/wkhtmltopdf
# 4: Continue with the rest of your Dockerfile:
COPY Gemfile* /usr/src/
Content type
Image
Digest
Size
43.1 MB
Last updated
almost 8 years ago
docker pull icalialabs/wkhtmltopdf