# https://github.com/michaelperrin/docker-wkhtmltopdf/blob/master/Dockerfile
# FROM debian:buster
# RUN apt-get update \
#     && apt-get install -y \
#         curl \
#         libxrender1 \
#         libjpeg62-turbo \
#         fontconfig \
#         libxtst6 \
#         xfonts-75dpi \
#         xfonts-base \
#         xz-utils

# RUN curl "https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_amd64.deb" -L -o "wkhtmltopdf.deb"
# RUN dpkg -i wkhtmltopdf.deb
# ENTRYPOINT ["wkhtmltopdf"]



# --------------------------------
# https://github.com/alloylab/Docker-Alpine-wkhtmltopdf/blob/master/Dockerfile
# A Tuan
# FROM alpine:edge
# MAINTAINER Trevor Ferre <trevor@alloylab.com>

# # install qt build packages #
# RUN echo "http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
# RUN apk add --update \
#     git patch gtk+ openssl glib fonts-base fonts-extra \
#     make g++ glib-dev gtk+-dev mesa-dev openssl-dev
# RUN rm -rf /var/cache/apk/*

# # wkhtmltopdf #
# RUN git clone --recursive https://github.com/wkhtmltopdf/wkhtmltopdf.git /tmp/wkhtmltopdf

# COPY conf/qt-musl.patch /tmp/wkhtmltopdf/qt/qt-musl.patch
# COPY conf/qt-musl-iconv-no-bom.patch /tmp/wkhtmltopdf/qt/qt-musl-iconv-no-bom.patch
# COPY conf/qt-recursive-global-mutex.patch /tmp/wkhtmltopdf/qt/qt-recursive-global-mutex.patch
# COPY conf/qt-font-pixel-size.patch /tmp/wkhtmltopdf/qt/qt-font-pixel-size.patch

# RUN cd /tmp/wkhtmltopdf/qt && \
#     patch -p1 -i qt-musl.patch && \
#     patch -p1 -i qt-musl-iconv-no-bom.patch && \
#     patch -p1 -i qt-recursive-global-mutex.patch && \
#     patch -p1 -i qt-font-pixel-size.patch && \
#     sed -i "s|-O2|$CXXFLAGS|" mkspecs/common/g++.conf && \
#     sed -i "/^QMAKE_RPATH/s| -Wl,-rpath,||g" mkspecs/common/g++.conf && \
#     sed -i "/^QMAKE_LFLAGS\s/s|+=|+= $LDFLAGS|g" mkspecs/common/g++.conf && \
#     ./configure -confirm-license -opensource \
#         -prefix /usr \
#         -datadir /usr/share/qt \
#         -sysconfdir /etc \
#         -plugindir /usr/lib/qt/plugins \
#         -importdir /usr/lib/qt/imports \
#         -fast \
#         -release \
#         -static \
#         -largefile \
#         -glib \
#         -graphicssystem raster \
#         -qt-zlib \
#         -qt-libpng \
#         -qt-libmng \
#         -qt-libtiff \
#         -qt-libjpeg \
#         -svg \
#         -webkit \
#         -gtkstyle \
#         -xmlpatterns \
#         -script \
#         -scripttools \
#         -openssl-linked \
#         -nomake demos \
#         -nomake docs \
#         -nomake examples \
#         -nomake tools \
#         -nomake tests \
#         -nomake translations \
#         -no-qt3support \
#         -no-pch \
#         -no-icu \
#         -no-phonon \
#         -no-phonon-backend \
#         -no-rpath \
#         -no-separate-debug-info \
#         -no-dbus \
#         -no-opengl \
#         -no-openvg && \
#     make --silent && \
#     make install && \
#     cd /tmp/wkhtmltopdf && \
#     qmake && \
#     make --silent && \
#     make install && \
#     rm -rf /tmp/*

# # remove qt build packages #
# RUN apk del --update \
#     make g++ glib-dev gtk+-dev mesa-dev openssl-dev
# RUN rm -rf /var/cache/apk/*



# --------------------------------
# Bao
# FROM alpine:latest
# RUN apk add --no-cache \
#   libstdc++ \
#   libx11 \
#   libxrender \
#   libxext \
#   libssl1.1 \
#   ca-certificates \
#   fontconfig \
#   freetype \
#   ttf-dejavu \
#   ttf-droid \
#   ttf-freefont \
#   ttf-liberation \
#   curl \
#   fontconfig
# COPY --from=icalialabs/wkhtmltopdf:alpine /bin/wkhtmltopdf /bin/wkhtmltopdf
# ENTRYPOINT ["wkhtmltopdf"]



# --------------------------------
# https://github.com/madnight/docker-alpine-wkhtmltopdf/blob/master/Dockerfile
# FROM alpine:3.13
# MAINTAINER Fabian Beuke <mail@beuke.org>

# RUN apk add --update --no-cache \
#     libgcc libstdc++ libx11 glib libxrender libxext libintl \
#     ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-ubuntu-font-family

# # On alpine static compiled patched qt headless wkhtmltopdf (46.8 MB).
# # Compilation took place in Travis CI with auto push to Docker Hub see
# # BUILD_LOG env. Checksum is printed in line 13685.
# COPY --from=madnight/alpine-wkhtmltopdf-builder:0.12.5-alpine3.10-606718795 \
#     /bin/wkhtmltopdf /bin/wkhtmltopdf
# ENV BUILD_LOG=https://api.travis-ci.org/v3/job/606718795/log.txt

# RUN [ "$(sha256sum /bin/wkhtmltopdf | awk '{ print $1 }')" == \
#       "$(wget -q -O - $BUILD_LOG | sed -n '13685p' | awk '{ print $1 }')" ]

# ENTRYPOINT ["wkhtmltopdf"]