The ODBC driver failed to load at runtime because libgssapi_krb5.so.2 was not installed. Add it explicitly to the apt-get install step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
22 lines
895 B
Docker
22 lines
895 B
Docker
FROM python:3.12-slim
|
|
|
|
# Install Microsoft ODBC Driver 18 for SQL Server
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
curl \
|
|
gnupg2 \
|
|
apt-transport-https \
|
|
unixodbc-dev \
|
|
&& curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg \
|
|
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/debian/12/prod bookworm main" > /etc/apt/sources.list.d/mssql-release.list \
|
|
&& apt-get update \
|
|
&& ACCEPT_EULA=Y apt-get install -y --no-install-recommends msodbcsql18 libgssapi-krb5-2 \
|
|
&& apt-get purge -y --auto-remove curl gnupg2 apt-transport-https \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
COPY . .
|
|
CMD ["python", "bot.py"]
|