Files
ortools-clone/cmake/docker/opensuse/java.Dockerfile

37 lines
889 B
Docker
Raw Permalink Normal View History

FROM ortools/cmake:opensuse_swig AS env
2024-07-22 13:53:01 +02:00
# Install Java JDK and Maven
RUN zypper refresh \
&& zypper install -y java-17-openjdk-devel maven \
2020-03-30 12:53:33 +02:00
&& zypper clean -a
ENV PATH=/usr/share/maven/bin:$PATH
2020-03-30 12:53:33 +02:00
FROM env AS devel
WORKDIR /home/project
2020-03-30 12:53:33 +02:00
COPY . .
ARG CMAKE_BUILD_PARALLEL_LEVEL
ENV CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-4}
2020-03-30 12:53:33 +02:00
FROM devel AS build
2021-03-10 18:05:49 +01:00
RUN cmake -S. -Bbuild -DBUILD_JAVA=ON -DSKIP_GPG=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 -v
2020-03-30 12:53:33 +02:00
FROM build AS test
RUN CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test -v
2020-03-30 12:53:33 +02:00
FROM env AS install_env
COPY --from=build /usr/local /usr/local/
FROM install_env AS install_devel
WORKDIR /home/sample
COPY cmake/samples/java .
2020-03-30 12:53:33 +02:00
FROM install_devel AS install_build
RUN mvn compile
2020-03-30 12:53:33 +02:00
FROM install_build AS install_test
RUN mvn test