-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (45 loc) · 1.58 KB
/
Dockerfile
File metadata and controls
57 lines (45 loc) · 1.58 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM xdbc-client:latest
ENV DEBIAN_FRONTEND=noninteractive
# Install OS deps
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
software-properties-common unixodbc-dev \
build-essential libboost-all-dev libpq-dev pybind11-dev \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
python3.9 python3.9-distutils python3.9-venv python3.9-dev python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Upgrade pip
RUN python3.9 -m pip install --upgrade pip uv
# Install all Python deps together so pybind11 is available before turbodbc builds
RUN python3.9 -m pip install pybind11
RUN python3.9 -m pip install \
pandas==2.2.* \
duckdb==1.0.0 \
sqlalchemy==2.0.35 \
connectorx==0.3.3 \
pyarrow==18.1.0 \
modin[ray]==0.30.1 \
ray==2.1.0 \
psycopg2-binary \
turbodbc==4.4.0
# Update postgres ODBC driver location
RUN full_path=$(locate psqlodbca.so | head -n 1) && \
sed -i "s|Driver=psqlodbca.so|Driver=$full_path|g" /etc/odbcinst.ini
# Copy source
COPY python/ /workspace/python
COPY tests/ /workspace/tests
COPY CMakeLists.txt /workspace
# pyarrow from pip
RUN python3.9 -m pip install pyarrow==18.1.0
RUN python3.9 -m pip install numpy
# Build C++ library and install to Python site-packages
RUN cd /workspace && mkdir -p build && cd build && rm -rf * && \
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DPython3_EXECUTABLE=$(which python3.9) \
-DPython3_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.9.so && \
make && \
make install
WORKDIR /workspace