wkhtmltopdf: QStandardPaths: XDG_RUNTIME_DIR 未设置,默认为 /tmp/runtime-root

ElG*_*_76 9 php wkhtmltopdf docker sylius alpine-linux

我正在使用 Docker 映像php:8.0-fpm-alpine3.14,我有一个 Sylius 项目并且我想使用它wkhtmltopdf,所以我在 Dockerfile 中添加了这些行:

RUN apk --update --no-cache add \
   wkhtmltopdf \
    libgcc \
    libstdc++ \
    musl \
    qt5-qtbase \
    qt5-qtbase-x11 \
    qt5-qtsvg \
    qt5-qtwebkit \
    ttf-freefont \
    ttf-dejavu \
    ttf-droid \
    ttf-liberation \
    xvfb \
    fontconfig

# Add openssl dependencies for wkhtmltopdf
RUN echo 'https://dl-cdn.alpinelinux.org/alpine/v3.8/main' >> /etc/apk/repositories && \
    apk add --no-cache libcrypto1.0 libssl1.0

RUN ln -s /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf;
RUN chmod +x /usr/local/bin/wkhtmltopdf;
Run Code Online (Sandbox Code Playgroud)

但是当我尝试使用时出现此错误wkhtmltopdf

> 块引用

我不明白为什么会出现该错误以及如何解决该错误。

谢谢