docker alpine wkhtmltopdf

截止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/

# 其他操作
原文地址:https://www.cnblogs.com/fqybzhangji/p/11354163.html