p≡p for Java
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.3 KiB

  1. ARG DOCKER_REGISTRY_HOST
  2. ARG CURRENT_DISTRO
  3. ARG PEPENGINE_VERSION
  4. FROM ${DOCKER_REGISTRY_HOST}/pep-${CURRENT_DISTRO}-engine:${PEPENGINE_VERSION} AS builder
  5. ENV BUILDROOT /build
  6. ENV INSTPREFIX /install
  7. ENV OUTDIR /out
  8. ARG LIBPEPADAPTER_VERSION
  9. ARG CURRENT_DISTRO
  10. ## Build and install libpEpAdapter
  11. ### Setup working directory
  12. RUN git clone --depth=1 \
  13. https://gitea.pep.foundation/pEp.foundation/libpEpAdapter.git \
  14. -b ${LIBPEPADAPTER_VERSION} \
  15. ${BUILDROOT}/libpEpAdapter
  16. WORKDIR ${BUILDROOT}/libpEpAdapter
  17. ### Build libpEpAdapter
  18. RUN sh ./scripts/${CURRENT_DISTRO}/build_libpEpAdapter.sh && \
  19. rm -rf ${BUILDROOT}/*
  20. ## Build and install pEpJNIAdapter
  21. ### Install Java 8
  22. USER root
  23. RUN apt-get update -yqq && \
  24. apt-get install -yqq apt-transport-https ca-certificates wget dirmngr gnupg2 software-properties-common && \
  25. wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add - && \
  26. add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ && \
  27. apt-get update -yqq && \
  28. apt-get install -yqq adoptopenjdk-8-hotspot && \
  29. rm -rf /var/lib/apt/lists/*
  30. USER pep-builder
  31. ### Setup working directory
  32. RUN mkdir ${BUILDROOT}/pEpJNIAdapter
  33. COPY . ${BUILDROOT}/pEpJNIAdapter
  34. USER root
  35. RUN chown -R pep-builder:pep-builder ${BUILDROOT}/pEpJNIAdapter
  36. USER pep-builder
  37. WORKDIR ${BUILDROOT}/pEpJNIAdapter
  38. ARG PEPJNIADAPTER_VERSION
  39. ARG CURRENT_DISTRO
  40. ### Build pEpJNIAdapter
  41. RUN sh ./scripts/${CURRENT_DISTRO}/build_pEpJNIAdapter.sh && \
  42. install -m 644 -t ${INSTPREFIX}/lib dist/libpEpJNI.a && \
  43. install -m 755 -t ${INSTPREFIX}/lib dist/libpEpJNI.so && \
  44. install -m 644 -t ${INSTPREFIX}/lib dist/pEp.jar
  45. ### Cleanup
  46. RUN find /install -name '*.a' -delete && \
  47. rm -rf /install/lib/sequoia/ && \
  48. rm -f /install/lib/libsequoia_ffi.so*
  49. ## Switch to final image
  50. FROM openjdk:8-slim-buster@sha256:cf05a507973843bd6a1ded846c94a5e655e0a3d4796ae17de54545403252901a
  51. ENV LD_LIBRARY_PATH=/install/lib:/install/libetpan/lib:$LD_LIBRARY_PATH
  52. COPY --from=builder /install/include /install/include
  53. COPY --from=builder /install/lib /install/lib
  54. COPY --from=builder /install/libetpan /install/libetpan
  55. COPY --from=builder /share/pEp /share/pEp
  56. COPY --from=builder /build /build
  57. RUN apt-get update -yqq && \
  58. apt-get install -yqq --no-install-recommends sqlite3 && \
  59. rm -rf /var/lib/apt/lists/*