forked from aio-libs/aioodbc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
34 lines (29 loc) · 1.21 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
34
ARG PYTHON_VERSION
FROM python:${PYTHON_VERSION}-slim
# configure apt to install minimal dependencies in non-interactive mode.
ENV DEBIAN_FRONTEND noninteractive
RUN echo 'APT::Install-Recommends "false";' >> /etc/apt/apt.conf; \
echo 'APT::Install-Suggests "false";' >> /etc/apt/apt.conf
RUN \
export MYSQL_CONNECTOR='mysql-connector-odbc-8.0.31-linux-glibc2.27-x86-64bit' \
&& apt-get update && apt-get install -y \
unixodbc-dev unixodbc \
wget libtool build-essential g++ \
odbc-postgresql \
libsqlite3-dev \
libsqliteodbc \
&& wget https://dev.mysql.com/get/Downloads/Connector-ODBC/8.0/${MYSQL_CONNECTOR}.tar.gz \
&& tar xvzf ${MYSQL_CONNECTOR}.tar.gz \
&& cp ${MYSQL_CONNECTOR}/bin/* /usr/bin/. \
&& cp ${MYSQL_CONNECTOR}/lib/lib* /usr/local/lib/. \
&& myodbc-installer -a -d -n "MySQL ODBC 8.0 Driver" -t "Driver=/usr/local/lib/libmyodbc8w.so" \
&& myodbc-installer -a -d -n "MySQL ODBC 8.0" -t "Driver=/usr/local/lib/libmyodbc8a.so" \
&& rm -rf ${MYSQL_CONNECTOR}* \
&& apt-get autoremove -y
WORKDIR /aioodbc
COPY requirements-dev.txt .
RUN pip install -U pip setuptools && \
pip install -r requirements-dev.txt
COPY . .
RUN pip install -e .
WORKDIR /aioodbc