Skip to content

Instantly share code, notes, and snippets.

@Hispar
Created July 30, 2019 10:51
Show Gist options
  • Save Hispar/9d6feafc54d49ef4c413c7503b42ee9b to your computer and use it in GitHub Desktop.
Save Hispar/9d6feafc54d49ef4c413c7503b42ee9b to your computer and use it in GitHub Desktop.
Dockerfile for python3 with sqlserver connection
FROM ubuntu:18.04
ENV PYTHONUNBUFFERED 1
RUN apt-get update && apt-get install -y curl gnupg2 software-properties-common
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
#Ubuntu 18.04
RUN curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt-get update && apt-get install -y gcc libc-dev g++ libffi-dev libxml2 unixodbc-dev python3-pip libssl1.0.0
RUN apt-get upgrade -y libstdc++6
RUN apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql17
#RUN ldd /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1
RUN mkdir /src
WORKDIR /src
ADD . /src/
RUN pip3 install --no-cache-dir -r requirements.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment