Mssql-docker: MS ODBC Driver + PYODBC Doesn't work within Ubuntu 18.04 Docker container

Created on 24 Jul 2018  路  7Comments  路  Source: microsoft/mssql-docker

I wrote a simple little test app that connects to the database using SQLAlchemy / PyODBC / MS ODBC Driver 17.

If I configure it for Ubuntu 16.04 everything works fine:
Git Repo: https://github.com/superbobdthm/mssql-odbc (master branch)

If I configure it for Ubuntu 18.04, I receive the following error:
sqlalchemy.exc.DBAPIError: (pyodbc.Error) ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.2.so.0.1' : file not found (0) (SQLDriverConnect)") (Background on this error at: http://sqlalche.me/e/dbapi)

Git Repo: https://github.com/superbobdthm/mssql-odbc (ubuntu-18.04 branch)

I can run the exact same commands in the Dockerfile in an Ubuntu 18.04 Desktop or an Ubuntu:18.04 LXD container and I do not get the Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.2.so.0.1 error. Everything works fine.

Most helpful comment

Thanks very much for this. I also spent ages trying to debug this issue.
I ran: apt-get install libssl1.0.0 libssl-dev and all worked ok.

All 7 comments

I was able to resolve this. It appears that the ubuntu:18.04 Docker image doesn't contain libssl1.0.0 libssl-dev

Just ran into this issue. I'm not sure how this has been closed. Shouldn't the instructions be updated or better yet the package fixed to include this as a dependency?

@superbobdthm I spent hours on debugging this and thank you so much for your comment - a simple install within my container solved my issues <3

@Kolvin Glad, I could help!

Thanks very much for this. I also spent ages trying to debug this issue.
I ran: apt-get install libssl1.0.0 libssl-dev and all worked ok.

Yes, the ubuntu:18.04 Docker image need libssl1.0.0 libssl-dev to be installed.

Wow. After half a workday trying to get this to work, i found this post. I am running the ubuntu 18.10 docker image, and installing libssl1.0.0 libssl-dev worked for me as well. Thank you @superbobdthm !

Was this page helpful?
0 / 5 - 0 ratings