截止2019.08
wkhtmltopdf 還沒有 alpine 的版本 如需使用 需要在 alpine 環境中編譯 生成 wkhtmltopdf (使用 apk add wkhtmltopdf 運行報錯)
編輯可參考 https://github.com/ElfoLiNk/alpine-java-wkhtmltopdf
也可以從 elfolink/alpine-java-wkhtmltopdf 鏡像中將生成好的 wkhtmltopdf 拷貝出來 放入自己的dockerfile中進行使用
wkhtmltopdf版本爲 0.12.5-dev
https://github.com/fqybzhangji/alpine-wkhtmltopdf
FROM alpine # 安裝運行環境 RUN apk add libgcc libstdc++ libx11 glib libxrender libxext libintl libcrypto1.0 libssl1.0 ttf-freefont fontconfig # wkhtmltopdf COPY wkhtmltox /bin/ RUN chmod +x /bin/wkhtmltopdf # 安裝字體 RUN mkdir -p /usr/share/fonts/chinese/TrueType/ RUN cp simsun.ttc /usr/share/fonts/chinese/TrueType/ RUN cp simsun.ttf /usr/share/fonts/chinese/TrueType/ # 其他操作