-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (26 loc) · 1.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM python:3
ENV FREETDS_VERSION 1.00
#Install dependencies for PyODBC
RUN apt-get update \
&& apt-get install unixodbc-dev -y --no-install-recommends \
&& apt install unixodbc-bin -y --no-install-recommends \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src
#Download sources for FreeTDS driver
RUN wget -q -P . ftp://ftp.freetds.org/pub/freetds/stable/freetds-$FREETDS_VERSION.tar.gz \
&& tar -xzf freetds-$FREETDS_VERSION.tar.gz \
&& rm freetds-$FREETDS_VERSION.tar.gz \
&& apt-get remove wget -y
WORKDIR /usr/src/freetds-$FREETDS_VERSION
#Build FreeTDS driver
#Watch out for --prefix, as our driver will be stored at /prefix/libtdsodbc.so
#See the docs: http://www.freetds.org/userguide/config.htm
RUN ./configure --prefix=/usr/local \
&& make \
&& make install
RUN path=$(dpkg --search libtdsS.so) \
&& echo "[FreeTDS]\n\
Description = FreeTDS unixODBC Driver\n\
Driver = /usr/local/lib/libtdsodbc.so\n\
Setup = ${path#* }" >> /etc/odbcinst.ini