Skip to content
Advertisement

Connect to MSSQL using python jaydebeapi from inside a Docker Image

I have a Python code that’s running properly on my system (Mac OS Catalina) but is failing when I am using it in my docker image. I am open to having a completely new dockerfile as well if that can work.

JavaScript

I have the jar file next to my code so it can be picked up properly.

Here is my dockerfile:

JavaScript

The error that I am getting is:

JavaScript

Please suggest me better dockerfile that I can use. Thanks for the help 🙂

Advertisement

Answer

Found the solution, all I needed to do was to add the following line to my dockerfile.

JavaScript

The rest is the same and it worked like a charm! I tried working with pymssql, pyodbc (FreeTDS one) and nothing seemed to work for me.

Advertisement