2020-04-01 14:27:33 +02:00
|
|
|
FROM ortools/cmake:alpine_swig AS env
|
2020-11-30 21:12:51 +01:00
|
|
|
ENV PATH=/root/.local/bin:$PATH
|
2021-12-13 10:39:23 +01:00
|
|
|
RUN apk add --no-cache python3-dev py3-pip py3-wheel \
|
2021-11-29 16:30:20 +01:00
|
|
|
py3-numpy py3-pandas py3-matplotlib
|
2020-03-30 12:52:22 +02:00
|
|
|
|
|
|
|
|
FROM env AS devel
|
2020-04-01 14:27:33 +02:00
|
|
|
WORKDIR /home/project
|
2020-03-30 12:52:22 +02:00
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
FROM devel AS build
|
2022-02-21 15:29:54 +01:00
|
|
|
RUN cmake -S. -Bbuild -DBUILD_PYTHON=ON -DVENV_USE_SYSTEM_SITE_PACKAGES=ON \
|
|
|
|
|
-DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF
|
2020-03-30 12:52:22 +02:00
|
|
|
RUN cmake --build build --target all -v
|
|
|
|
|
RUN cmake --build build --target install
|
|
|
|
|
|
|
|
|
|
FROM build AS test
|
2020-10-07 18:17:27 +02:00
|
|
|
RUN CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test
|
2020-03-30 12:52:22 +02:00
|
|
|
|
|
|
|
|
FROM env AS install_env
|
2020-04-01 14:27:33 +02:00
|
|
|
WORKDIR /home/sample
|
|
|
|
|
COPY --from=build /home/project/build/python/dist/*.whl .
|
|
|
|
|
RUN python3 -m pip install *.whl
|
2020-03-30 12:52:22 +02:00
|
|
|
|
|
|
|
|
FROM install_env AS install_devel
|
2020-04-01 14:27:33 +02:00
|
|
|
COPY cmake/samples/python .
|
2020-03-30 12:52:22 +02:00
|
|
|
|
|
|
|
|
FROM install_devel AS install_build
|
2020-04-01 14:27:33 +02:00
|
|
|
RUN python3 -m compileall .
|
2020-03-30 12:52:22 +02:00
|
|
|
|
|
|
|
|
FROM install_build AS install_test
|
2020-04-01 14:27:33 +02:00
|
|
|
RUN python3 sample.py
|