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

31 lines
684 B
Docker
Raw Normal View History

FROM ortools/cmake:centos_swig AS env
RUN dnf -y update \
&& dnf -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel maven \
&& dnf clean all \
&& rm -rf /var/cache/dnf
2020-03-30 12:52:41 +02:00
FROM env AS devel
WORKDIR /home/project
2020-03-30 12:52:41 +02:00
COPY . .
FROM devel AS build
RUN cmake -S. -Bbuild -DBUILD_DEPS=ON -DBUILD_JAVA=ON
RUN cmake --build build --target all
RUN cmake --build build --target install
FROM build AS test
RUN cmake --build build --target test
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:52:41 +02:00
FROM install_devel AS install_build
RUN mvn compile
2020-03-30 12:52:41 +02:00
FROM install_build AS install_test
RUN mvn test