Surnet / docker-wkhtmltopdf

wkhtmltopdf for multiple base images
https://hub.docker.com/u/surnet/
MIT License
360 stars 65 forks source link

Symbols not found: alpine-wkhtmltopdf with PHP-FPM 8.2 #32

Closed maxbethke closed 1 year ago

maxbethke commented 1 year ago

Hey, I am encountering problems with using alpine-wkhtmltopdf in PHP 8.2 and was hoping for some tipps here.

Environment

# dockerfile
FROM php:8.2-fpm-alpine AS base

[...]

COPY --from=surnet/alpine-wkhtmltopdf:3.10-0.12.5-full /bin/wkhtmltopdf /usr/bin/wkhtmltopdf
COPY --from=surnet/alpine-wkhtmltopdf:3.10-0.12.5-full /bin/wkhtmltoimage /usr/bin/wkhtmltoimage
COPY --from=surnet/alpine-wkhtmltopdf:3.10-0.12.5-full /bin/libwkhtmltox* /usr/bin/

Expected behaviour

I should be able to use the binaries to generate an image from html

Actual behaviour

Following errors get thrown

Handling "App\Messenger\Model\AssetProcessor\GeneratePdf" failed: The exit status code '127' says something went wrong:
stderr: "Error loading shared library libssl.so.1.1: No such file or directory (needed by /usr/bin/wkhtmltoimage)
Error loading shared library libcrypto.so.1.1: No such file or directory (needed by /usr/bin/wkhtmltoimage)
Error relocating /usr/bin/wkhtmltoimage: EVP_PKEY_base_id: symbol not found
Error relocating /usr/bin/wkhtmltoimage: EVP_PKEY_id: symbol not found
Error relocating /usr/bin/wkhtmltoimage: SSL_get_peer_certificate: symbol not found

I could fix this by symlinking libcrypto.so.1.1 and libssl.so.1.1 to the respective current libX.so in /usr/lib But I am still getting the last three errors

How to reproduce

Run /usr/bin/wkhtmltoimage --format 'jpg' --width '595' '/tmp/95887354.html' '/tmp/kpJICJ' in above env while having /tmp/95887354.html in place

chdanielmueller commented 1 year ago

Have you installed the other required packages in your image? Please see https://github.com/Surnet/docker-wkhtmltopdf#other-images

It has been updated not long ago in #31. Maybe there has something changed that helps you.

chdanielmueller commented 1 year ago

Please reopen the issue if it is not solved.