Skip to content

Commit

Permalink
Merge pull request #61 from laudio/feat/update-debian-version
Browse files Browse the repository at this point in the history
Update debian version to 12 (bookworm)
  • Loading branch information
mesaugat authored Dec 29, 2023
2 parents 149d5cc + 72a6220 commit d2b966d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions images/pyodbc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# STAGE: base
# -----------
# The main image that is published.
FROM python:3.11-slim AS base
FROM python:3.11-slim-bookworm AS base

COPY requirements.txt .

Expand All @@ -14,16 +14,16 @@ RUN \
apt-get update && \
apt-get install -y curl build-essential unixodbc-dev g++ apt-transport-https && \
# Install pyodbc db drivers for MSSQL, PG and MySQL
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /usr/share/keyrings/microsoft-prod.gpg && \
curl -sSL https://packages.microsoft.com/config/debian/12/prod.list | tee /etc/apt/sources.list.d/mssql-release.list && \
curl -L -o ${MYSQL_CONNECTOR}.tar.gz https://dev.mysql.com/get/Downloads/Connector-ODBC/8.0/${MYSQL_CONNECTOR}.tar.gz && \
echo "${MYSQL_CONNECTOR_CHECKSUM} ${MYSQL_CONNECTOR}.tar.gz" | md5sum -c - && \
apt-get update && \
gunzip ${MYSQL_CONNECTOR}.tar.gz && tar xvf ${MYSQL_CONNECTOR}.tar && \
cp -r ${MYSQL_CONNECTOR}/bin/* /usr/local/bin && cp -r ${MYSQL_CONNECTOR}/lib/* /usr/local/lib && \
myodbc-installer -a -d -n "MySQL ODBC 8.0.33 Driver" -t "Driver=/usr/local/lib/libmyodbc8w.so" && \
myodbc-installer -a -d -n "MySQL ODBC 8.0.33" -t "Driver=/usr/local/lib/libmyodbc8a.so" && \
apt-get install -y msodbcsql17 msodbcsql18 odbc-postgresql && \
ACCEPT_EULA=Y apt-get install -y msodbcsql17 msodbcsql18 odbc-postgresql && \
# Update odbcinst.ini to make sure full path to driver is listed, and set CommLog to 0. i.e disables any communication logs to be written to files
sed 's/Driver=psql/Driver=\/usr\/lib\/x86_64-linux-gnu\/odbc\/psql/;s/CommLog=1/CommLog=0/' /etc/odbcinst.ini > /tmp/temp.ini && \
mv -f /tmp/temp.ini /etc/odbcinst.ini && \
Expand Down

0 comments on commit d2b966d

Please sign in to comment.