2020-04-01 14:27:33 +02:00
|
|
|
FROM ortools/cmake:opensuse_swig AS env
|
2020-11-30 21:12:51 +01:00
|
|
|
ENV PATH=/root/.local/bin:$PATH
|
2022-06-10 16:32:35 +02:00
|
|
|
RUN zypper refresh \
|
2023-08-17 18:07:08 +02:00
|
|
|
&& zypper install -y python311 python311-devel \
|
2024-02-09 16:13:14 +01:00
|
|
|
python311-pip python311-wheel python311-virtualenv python311-setuptools \
|
2020-03-30 12:53:33 +02:00
|
|
|
&& zypper clean -a
|
2023-10-25 09:32:44 +02:00
|
|
|
RUN python3.11 -m pip install --break-system-packages \
|
|
|
|
|
absl-py mypy mypy-protobuf
|
2020-03-30 12:53:33 +02:00
|
|
|
|
|
|
|
|
FROM env AS devel
|
2020-04-01 14:27:33 +02:00
|
|
|
WORKDIR /home/project
|
2020-03-30 12:53:33 +02:00
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
FROM devel AS build
|
2020-09-15 14:20:39 +02:00
|
|
|
RUN cmake -S. -Bbuild -DBUILD_PYTHON=ON -DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF
|
2020-03-30 12:53:33 +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:53:33 +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 .
|
2023-10-14 01:58:09 +02:00
|
|
|
RUN python3 -m pip install --break-system-packages *.whl
|
2020-03-30 12:53:33 +02:00
|
|
|
|
|
|
|
|
FROM install_env AS install_devel
|
2020-04-01 14:27:33 +02:00
|
|
|
COPY cmake/samples/python .
|
2020-03-30 12:53:33 +02:00
|
|
|
|
|
|
|
|
FROM install_devel AS install_build
|
2020-04-01 14:27:33 +02:00
|
|
|
RUN python3 -m compileall .
|
2020-03-30 12:53:33 +02:00
|
|
|
|
|
|
|
|
FROM install_build AS install_test
|
2020-04-01 14:27:33 +02:00
|
|
|
RUN python3 sample.py
|