Connecting to mssql database from app made with python in container instance

Expected behavior

I have created a python script to connect with azure database which is running fine locally and in azure python functions.

Actual behavior

But when deployed in azure container instance. It was throwing error that Odbc 17 Driver not found.

Additional Information

Steps to reproduce the behavior

  1. Steps in docker file

FROM python:3.6.8
RUN mkdir \opt\message_to_event_hub
WORKDIR \opt\message_to_event_hub
ADD odbcinst.ini /etc/odbcinst.ini
RUN apt-get update
RUN apt-get install -y tdsodbc unixodbc-dev unixodbc unixodbc-bin
RUN apt install unixodbc-bin -y
RUN apt-get clean -y
RUN pip install pyodbc
RUN apt-get install -y curl wget gnupg
RUN curl | apt-key add -
RUN apt-get install unixodbc-dev
*RUN TEMP_DEB="$(mktemp)" *
*&& ACCEPT_EULA=Y && wget -O “$TEMP_DEB” ‘’ *
*&& yes | dpkg --skip-same-version -i “$TEMP_DEB” *
&& rm -f “$TEMP_DEB”
*ADD . . *
CMD [“python3”,“”]

  1. python steps to connect with database

import pyodbc