-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile.python
56 lines (44 loc) · 2.67 KB
/
Dockerfile.python
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
ARG TARGETARCH=amd64
FROM quay.io/pypa/manylinux2014_x86_64 AS base_amd64
FROM quay.io/pypa/manylinux2014_aarch64 AS base_arm64
FROM base_$TARGETARCH
# Install numpy for Boost
RUN python3.7 -mpip install -U numpy \
&& python3.8 -mpip install -U numpy \
&& python3.9 -mpip install -U numpy \
&& python3.10 -mpip install -U numpy \
&& python3.11 -mpip install -U numpy \
&& python3.12 -mpip install -U numpy
ENV BOOST_VERSION "1.84.0"
ENV BOOST_VERSION_ "1_84_0"
RUN curl -LO https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_}.tar.gz \
&& tar -xzf boost_${BOOST_VERSION_}.tar.gz \
&& rm /boost_${BOOST_VERSION_}.tar.gz \
&& cd /boost_${BOOST_VERSION_} \
&& sh ./bootstrap.sh \
&& echo "using python : 3.7 : /opt/python/cp37-cp37m/bin/python : /opt/python/cp37-cp37m/include/python3.7m : /opt/python/cp37-cp37m/lib ;" >> tools/build/src/user-config.jam \
&& echo "using python : 3.8 : /opt/python/cp38-cp38/bin/python : /opt/python/cp38-cp38/include/python3.8 : /opt/python/cp38-cp38/lib ;" >> tools/build/src/user-config.jam \
&& echo "using python : 3.9 : /opt/python/cp39-cp39/bin/python : /opt/python/cp39-cp39/include/python3.9 : /opt/python/cp39-cp39/lib ;" >> tools/build/src/user-config.jam \
&& echo "using python : 3.10 : /opt/python/cp310-cp310/bin/python : /opt/python/cp310-cp310/include/python3.10 : /opt/python/cp310-cp310/lib ;" >> tools/build/src/user-config.jam \
&& echo "using python : 3.11 : /opt/python/cp311-cp311/bin/python : /opt/python/cp311-cp311/include/python3.11 : /opt/python/cp311-cp311/lib ;" >> tools/build/src/user-config.jam \
&& echo "using python : 3.12 : /opt/python/cp312-cp312/bin/python : /opt/python/cp312-cp312/include/python3.12 : /opt/python/cp312-cp312/lib ;" >> tools/build/src/user-config.jam \
&& ./b2 -d+2 python=3.7,3.8,3.9,3.10,3.11,3.12 link=static cflags="-fPIC" cxxflags="-fPIC" install \
&& cd / \
&& rm -rf /boost_${BOOST_VERSION_}
RUN python3.12 -m pip install -U auditwheel twine
ENV SOURCE "/tmp/source"
ENV BUILD "/tmp/build"
ENV DIST "/dist"
ENV SKBUILD_CONFIGURE_OPTIONS="-DSTATIC_LINKING=TRUE"
COPY CMakeLists.txt freddi.ini pyproject.toml setup.py MANIFEST.in Readme.md ${SOURCE}/
COPY cpp ${SOURCE}/cpp
COPY python ${SOURCE}/python
WORKDIR ${SOURCE}
RUN python3.12 -mbuild --sdist -o${DIST}
RUN python3.7 -mbuild -o${BUILD} \
&& python3.8 -mbuild -o${BUILD} \
&& python3.9 -mbuild -o${BUILD} \
&& python3.10 -mbuild -o${BUILD} \
&& python3.11 -mbuild -o${BUILD} \
&& python3.12 -mbuild -o${BUILD}
RUN ls ${BUILD}/*.whl | xargs -iZZZ python3.12 -m auditwheel repair --wheel-dir=${DIST} ZZZ