forked from hombit/freddi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.python
More file actions
51 lines (41 loc) · 2.69 KB
/
Dockerfile.python
File metadata and controls
51 lines (41 loc) · 2.69 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
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
RUN python3.7 -mpip install -U pip && python3.7 -mpip install -U numpy wheel setuptools cmake ninja scikit-build \
&& python3.8 -mpip install -U pip && python3.8 -mpip install -U numpy wheel setuptools cmake ninja scikit-build \
&& python3.9 -mpip install -U pip && python3.9 -mpip install -U numpy wheel setuptools cmake ninja scikit-build \
&& python3.10 -mpip install -U pip && python3.10 -mpip install -U numpy wheel setuptools cmake ninja scikit-build
ENV BOOST_VERSION "1.78.0"
ENV BOOST_VERSION_ "1_78_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 \
&& ./b2 -d+2 python=3.7,3.8,3.9,3.10 link=static cflags="-fPIC" cxxflags="-fPIC" install \
&& cd / \
&& rm -rf /boost_${BOOST_VERSION_}
RUN python3.7 -m pip install -U auditwheel twine
ENV SOURCE "/tmp/source"
ENV BUILD "/tmp/build"
ENV DIST "/dist"
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.7 setup.py sdist -d${DIST}
RUN NCPUS=$(grep -c ^processor /proc/cpuinfo) \
&& python3.7 setup.py bdist_wheel -DSTATIC_LINKING=TRUE -d${BUILD} -- -- -j$NCPUS \
&& rm -r _skbuild \
&& python3.8 setup.py bdist_wheel -DSTATIC_LINKING=TRUE -d${BUILD} -- -- -j$NCPUS \
&& rm -r _skbuild \
&& python3.9 setup.py bdist_wheel -DSTATIC_LINKING=TRUE -d${BUILD} -- -- -j$NCPUS \
&& rm -r _skbuild \
&& python3.10 setup.py bdist_wheel -DSTATIC_LINKING=TRUE -d${BUILD} -- -- -j$NCPUS \
&& rm -r _skbuild
RUN ls ${BUILD}/*.whl | xargs -iZZZ python3.7 -m auditwheel repair --wheel-dir=${DIST} ZZZ