docker-bookstack
docker-bookstack copied to clipboard
wkhtmltopdf not found in image.
After digging a bit, I found that the package wkhtmltopdf is not available for Alpine version 3.16, and make the apk add wkhtmltopdf
command in the dockerfile fail
Expected Behavior
Current Behavior
Steps to Reproduce
- Run the container with the environment variable
WKHTMLTOPDF=/usr/bin/wkhtmltopdf
- try to export a page in bookstack
Environment
OS: Debian 11 CPU architecture: x86_64 How docker service was installed: Official docker script
Command used to create docker container (run/create/compose/screenshot)
Docker run
Docker logs
There is no output in the docker itself, but when trying to export a page to PDF in bookstack I get the error that the binary wkhtmltopdf is not found.
The exit status code '127' says something went wrong: stderr: "sh: /usr/bin/wkhtmltopdf: not found " stdout: "" command: /usr/bin/wkhtmltopdf --lowquality --page-size 'A4' --outline --print-media-type '/tmp/knp_snappy6322017b115a82.05430218.html' '/tmp/knp_snappy6322017b1166b6.69407541.pdf'.
Sorry if my bug report is not clear enough, don't hesitate to make me correct some things !
Why are you opening 2 issues about the same thing? Why not just edit/comment on your original issue you opened?
Why are you opening 2 issues about the same thing? Why not just edit/comment on your original issue you opened?
Sorry, I didn't see that I made two issues by missclick
We used to be able to install wkhtmltopdf using a older alpine version, but this way is now incompatible with the version we ship, as it has been dropped from the alpine repos due to being unmaintained.
So, is there something planned to work around ?
We are still discussing our options.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
+1 I would like that dependency back because de default PDR renderer is not very great
+1 wkhtmltopdf would be brill!
Is there something planned about this ? perhaps somebody found a workaround
Not an elegant solution but I'm manually copying wkhtmltopdf into the container and installing the dependencies.
docker cp ./wkhtmltopdf bookstack:/usr/bin/wkhtmltopdf
docker exec -it bookstack /bin/bash
apk add --update --no-cache libgcc libstdc++ libx11 glib libxrender libxext libintl ttf-dejavu ttf-droid ttf-freefont ttf-liberation
Remember you need to do this every time you upgrade the container.
No idea what the security implications are so use at your own risk.
Not an elegant solution but I'm manually copying wkhtmltopdf into the container and installing the dependencies.
docker cp ./wkhtmltopdf bookstack:/usr/bin/wkhtmltopdf docker exec -it bookstack /bin/bash apk add --update --no-cache libgcc libstdc++ libx11 glib libxrender libxext libintl ttf-dejavu ttf-droid ttf-freefont ttf-liberation
Remember you need to do this every time you upgrade the container.
No idea what the security implications are so use at your own risk.
you don't need to do this every time, you can make it automatically persistent: https://docs.linuxserver.io/general/container-customization
good work-around!
I made a different workaround by using weasyprint
, which is included in alpine, and a proxy script and installing it using container customization.
https://gist.github.com/kmpm/c254558fcb0608346f49946a53cd8c09
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I made a different workaround by using
weasyprint
, which is included in alpine, and a proxy script and installing it using container customization. https://gist.github.com/kmpm/c254558fcb0608346f49946a53cd8c09
Sorry for the delay, have you fully tested this as a working replacement for wkhtmltopdf? if yes, do you mind submitting a PR?
There are some differences in the output of weasyprint but it "works for me". It's quite easy to customize using css though. I'll look into how this can be turned into a PR.
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
Same issue, it seems wkhtmltopdf is missing from the image, but is listed in the documentation.
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
This issue is locked due to inactivity