Files
ortools-clone/cmake/docker/archlinux/python.Dockerfile

38 lines
1.0 KiB
Docker
Raw Permalink Normal View History

FROM ortools/cmake:archlinux_swig AS env
2024-07-22 13:53:01 +02:00
2020-11-30 21:12:51 +01:00
ENV PATH=/root/.local/bin:$PATH
2023-06-15 17:19:06 +02:00
RUN pacman -Syu --noconfirm python python-pip \
2024-04-28 22:03:37 +02:00
python-wheel python-virtualenv python-setuptools \
2023-06-15 17:19:15 +02:00
python-numpy python-pandas
2023-06-15 17:19:06 +02:00
RUN python -m pip install --break-system-package \
2023-10-25 09:32:44 +02:00
absl-py mypy mypy-protobuf
2020-03-30 12:52:32 +02:00
FROM env AS devel
WORKDIR /home/project
2020-03-30 12:52:32 +02:00
COPY . .
ARG CMAKE_BUILD_PARALLEL_LEVEL
ENV CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-4}
2020-03-30 12:52:32 +02:00
FROM devel AS build
RUN cmake -S. -Bbuild -DBUILD_PYTHON=ON -DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF
2020-03-30 12:52:32 +02:00
RUN cmake --build build --target all -v
RUN cmake --build build --target install
FROM build AS test
RUN CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test
2020-03-30 12:52:32 +02:00
FROM env AS install_env
WORKDIR /home/sample
COPY --from=build /home/project/build/python/dist/*.whl .
2023-06-15 17:19:06 +02:00
RUN python -m pip install --break-system-packages *.whl
2020-03-30 12:52:32 +02:00
FROM install_env AS install_devel
COPY cmake/samples/python .
2020-03-30 12:52:32 +02:00
FROM install_devel AS install_build
RUN python -m compileall .
2020-03-30 12:52:32 +02:00
FROM install_build AS install_test
RUN python sample.py