From c96f772f01bab57fe002f3d28c25e591663dba0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AD=90=E9=BB=98?= <925456043@qq.com> Date: Wed, 19 Aug 2026 22:42:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=9A=94=E7=A6=BB=20LibreOffice=20?= =?UTF-8?q?=E5=B9=B6=E5=8F=91=E8=BD=AC=E6=8D=A2=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为每次 soffice 调用创建独立临时用户配置目录 - 转换结束后自动清理并保持无头安全启动参数 --- Dockerfile | 3 ++- docker-soffice-wrapper.sh | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 docker-soffice-wrapper.sh diff --git a/Dockerfile b/Dockerfile index 2e1e946b..58fdbc78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -129,8 +129,9 @@ RUN fc-cache -f && \ mkdir -p /app/logs /app/artifacts /app/data && \ chown -R easyflow:easyflow /app +COPY docker-soffice-wrapper.sh /usr/local/bin/soffice COPY docker-entrypoint.sh /usr/local/bin/easyflow-entrypoint.sh -RUN chmod 755 /usr/local/bin/easyflow-entrypoint.sh +RUN chmod 755 /usr/local/bin/soffice /usr/local/bin/easyflow-entrypoint.sh VOLUME ["/app/logs", "/app/data"] EXPOSE 8111 diff --git a/docker-soffice-wrapper.sh b/docker-soffice-wrapper.sh new file mode 100644 index 00000000..9093b8c0 --- /dev/null +++ b/docker-soffice-wrapper.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env sh +set -eu + +profile_parent="${TMPDIR:-/tmp}" +profile_dir="$(mktemp -d "${profile_parent%/}/easyflow-soffice-XXXXXX")" + +cleanup() { + rm -rf -- "$profile_dir" +} + +trap cleanup EXIT HUP INT TERM + +/usr/bin/soffice \ + -env:UserInstallation="file://${profile_dir}" \ + --headless \ + --safe-mode \ + --nologo \ + --nodefault \ + --nolockcheck \ + --norestore \ + "$@"