Don't need Alpine Linux support? please use this gem instead!
If you are using wkhtmltopdf on heroku, please use this gem instead!
- Alpine Linux 3.15+ 64-bit
- Linux (Ubuntu Trusty+) 64-bit
- OS X 10.7+ 64-bit
In your Gemfile
:
gem 'wkhtmltopdf-binary-edge-alpine', '~> 0.12.6.3', github: 'khalilgharbaoui/wkhtmltopdf-binary-edge-alpine'
Add this layer in your Dockerfile
:
# Install dependencies for wkhtmltopdf
RUN apk add --update --no-cache --wait 10 \
libstdc++ \
libx11 \
libxrender \
libxext \
libssl1.1 \
ca-certificates \
fontconfig \
freetype \
ttf-dejavu \
ttf-droid \
ttf-freefont \
ttf-liberation && \
apk add --update --no-cache --virtual .build-deps \
msttcorefonts-installer && \
# Install microsoft fonts
update-ms-fonts && fc-cache -f && \
# Clean up when done
rm -rf /tmp/* && apk del .build-deps
Extracted from surnet/alpine-wkhtmltopdf:3.15.0-0.12.6-small
docker image:
docker run --rm --entrypoint cat \
surnet/alpine-wkhtmltopdf:3.15.0-0.12.6-small \
/bin/wkhtmltopdf > ./libexec/wkhtmltopdf-alpine-linux-amd64
See: wkhtmltopdf release notes
Image is shrunk due to a zoom bug in the wkhtmltopdf binary version 0.12.5.0 when on Alpine Linux.
Workaround is to set the zoom:
to exacly 1.3
.
See: wkhtmltopdf/wkhtmltopdf#4036
And also see: wkhtmltopdf/wkhtmltopdf#4036 (comment)
Please feel free to open a issue or pull request with suggestions.
Based upon the following repos: