From b639d95b13eae6fcb263122404e6c395efcfc632 Mon Sep 17 00:00:00 2001 From: zpc Date: Thu, 26 Mar 2026 22:51:18 +0800 Subject: [PATCH] chore(docker): Install SkiaSharp native dependencies for captcha generation - Add native library dependencies (libfontconfig1, libfreetype6) required by SkiaSharp - Install dependencies in final stage before application setup - Clean up apt cache to reduce image size - Ensure captcha generation functionality works in containerized environment --- server/MiAssessment/src/MiAssessment.Admin/Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/MiAssessment/src/MiAssessment.Admin/Dockerfile b/server/MiAssessment/src/MiAssessment.Admin/Dockerfile index eee1c02..2957964 100644 --- a/server/MiAssessment/src/MiAssessment.Admin/Dockerfile +++ b/server/MiAssessment/src/MiAssessment.Admin/Dockerfile @@ -20,6 +20,13 @@ RUN dotnet publish "src/MiAssessment.Admin/MiAssessment.Admin.csproj" -c Release # ==================== 最终运行阶段 ==================== FROM 192.168.195.25:19900/library/dotnet/aspnet:10.0-preview AS final + +# 安装 SkiaSharp 验证码生成所需的原生依赖 +RUN apt-get update && apt-get install -y --no-install-recommends \ + libfontconfig1 \ + libfreetype6 \ + && rm -rf /var/lib/apt/lists/* + WORKDIR /app COPY --from=build /app/publish . COPY --from=frontend /app/dist ./wwwroot