0

I have a docker file which uses python:3 (based on debian). I am installing the drivers for PyODBC as per the microsoft docs.

FROM python:3

RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
    curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
    apt-get update && \
    ACCEPT_EULA=Y apt-get install msodbcsql17 unixodbc-dev -y

I can build the image, but when trying to run it I get the error: Can't open lib /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1

I have ran: ldd /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1 and get the output that says the below two libs cannot be found:

libcrypto.so.1.0.2 => not found
libssl.so.1.0.2 => not found

I have also tried dpkg --search libssl and dpkg --search libsslcrypto which yielded:

libssl1.1:amd64: /usr/lib/x86_64-linux-gnu/libssl.so.1.1
libssl1.1:amd64: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1

From ldd /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1 there are other libraries being picked up in /usr/lib/x86_64-linux-gnu/

Very new to docker/linux, so how can I install libcrypto.so.1.0.2 and libssl.so.1.0.2 or downgrade the versions in '/usr/lib/x86_64-linux-gnu/' so that they can be used for msodbcsql17 (have tried apt get -y install libssl1.0=1.0.2) ?

James
  • 307
  • 8
  • 22

1 Answers1

2

The docker image python:3 appears to be built on Debian 10.

The package repository you are installing appears to be built for Debian 9, and does not appear to be compatible with Debian 10.

You should probably be using the repository with packages built for Debian 10 to get compatible packages.

GracefulRestart
  • 751
  • 4
  • 9
  • Possibly similar to the situation for Ubuntu 19.04 as mentioned in [this answer](https://stackoverflow.com/a/56257736/2144390): They intend to support it, but apparently "we're not quite there yet". – Gord Thompson Jul 26 '19 at 00:14
  • The switch from Debian 9 to debian 10 happened this month, so they currently don't support msodbcsql17. Therefore in the meantime I am using `python:3-stretch` to go back to the debian 9 build – James Jul 26 '19 at 09:47