'Looking for a Docker expert, dealing with issues to import data from Python into MSSQL

I have tried almost every blog in order to resolve this but nothing is working.

Error Message: pyodbc.OperationalError: ('HYT00', '[HYT00] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0) (SQLDriverConnect)')

Below is the Dockerfile I am having

FROM ubuntu:18.04

RUN apt-get update -y && \      
    apt-get install -y \    
    libpq-dev \     
    gcc \
    python3-pip \
    unixodbc-dev

RUN apt-get update && apt-get install -y \
    curl apt-utils apt-transport-https debconf-utils gcc build-essential g++-5\
    && rm -rf /var/lib/apt/lists/*

RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install -y --allow-unauthenticated msodbcsql17

RUN pip3 install pyodbc

WORKDIR /app

COPY requirements.txt requirements.txt


RUN pip3 install -r requirements.txt

COPY . .

CMD [ "python3", "test.py" ]

Below is the requirements file I am having

pyodbc==4.0.30
psycopg2-binary
sqlparams
pandas
xlrd


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source