From 0dc5a3d730764aa6455d8470d263798522fa8d69 Mon Sep 17 00:00:00 2001 From: lewis_yan Date: Wed, 1 Apr 2026 16:07:06 +0800 Subject: [PATCH] fix: add OpenSSL and Kerberos dependencies for msodbcsql18 driver The ODBC Driver 18 requires libssl, libcrypto, and Kerberos libraries to function. Also set LD_LIBRARY_PATH to include the driver lib64 directory. --- backend/Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 677eee0..06cf4bd 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -34,14 +34,18 @@ RUN ls ./conf/ \ # 第二阶段:运行时镜像 FROM docker.1ms.run/python:3.10-slim -RUN apt-get update && apt-get install -y unixodbc libodbc2 && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y \ + unixodbc libodbc2 \ + libssl3 libcrypto3 libkrb5-3 libgssapi-krb5-2 \ + && rm -rf /var/lib/apt/lists/* COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages COPY --from=builder /usr/local/bin /usr/local/bin COPY --from=builder /opt/microsoft/msodbcsql18 /opt/microsoft/msodbcsql18 COPY --from=builder /backend /backend -# 手动注册 ODBC Driver 18(写入 odbcinst.ini) +# 设置库路径并注册 ODBC Driver 18 +ENV LD_LIBRARY_PATH=/opt/microsoft/msodbcsql18/lib64:${LD_LIBRARY_PATH} RUN cat /opt/microsoft/msodbcsql18/etc/odbcinst.ini >> /etc/odbcinst.ini || true WORKDIR /backend