Skip to content

Instantly share code, notes, and snippets.

@asadMarmash
Created February 18, 2025 19:08
Show Gist options
  • Save asadMarmash/b2866169280ececb7cdc1bb289341573 to your computer and use it in GitHub Desktop.
Save asadMarmash/b2866169280ececb7cdc1bb289341573 to your computer and use it in GitHub Desktop.
dockerfile for installing wkhtmltopdf 0.12.6.1 (with patched qt)
FROM ubuntu:24.04
WORKDIR /app
RUN apt-get update -y
RUN apt-get install -y \
xfonts-75dpi \
wget \
fontconfig \
libjpeg-turbo8 \
libx11-6 \
libxcb1 \
libxext6 \
libxrender1 \
xfonts-base
RUN wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb
RUN dpkg -i wkhtmltox_0.12.6.1-2.jammy_amd64.deb
RUN apt --fix-broken install -y
RUN rm wkhtmltox_0.12.6.1-2.jammy_amd64.deb
@asadMarmash
Copy link
Author

How to build and run:

  1. Build the image:

    docker build -t wkhtmltopdf-container .
  2. Run the container with any wkhtmltopdf command:

    docker run wkhtmltopdf-container --version

    Output:

    wkhtmltopdf 0.12.6.1 (with patched qt)
    
  3. Run any wkhtmltopdf command, such as:

    docker run wkhtmltopdf-container input.html output.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment