Skip to content

Instantly share code, notes, and snippets.

@denismakogon
Created June 14, 2022 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save denismakogon/baec765777cf27d1f5b5f8805376de2c to your computer and use it in GitHub Desktop.
Save denismakogon/baec765777cf27d1f5b5f8805376de2c to your computer and use it in GitHub Desktop.
jextract dockerfile
FROM openjdk:19-bullseye as jdk19-source
FROM openjdk:18-bullseye as jextract-build-stage
COPY --from=jdk19-source /usr/local/openjdk-19 /usr/local/openjdk-19
WORKDIR tmp/
RUN apt-get update && apt-get install wget tar xz-utils git -qy --no-install-recommends
RUN mkdir deps && \
wget -O deps/LLVM.tar.gz https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.4/clang+llvm-14.0.4-x86_64-linux-gnu-ubuntu-20.04.tar.xz && \
tar -xvf deps/LLVM.tar.gz -C deps && rm -fr deps/LLVM.tar.gz && \
git clone https://github.com/openjdk/jextract.git && \
cd jextract && \
sh ./gradlew -Pjdk19_home=/usr/local/openjdk-19 -Pllvm_home=../deps/clang+llvm-14.0.4-x86_64-linux-gnu-ubuntu-20.04 clean verify && \
rm -fr /tmp/deps
FROM openjdk:19-bullseye as jdk19-custom-runtime
COPY --from=jextract-build-stage /tmp/jextract/build/jextract/ /usr/local/jextract
ENV PATH=${PATH}:/usr/local/jextract/bin
# installing additional necessary dev packages
RUN curl "https://raw.githubusercontent.com/denismakogon/openjdk-project-samples/master/scripts/install_build_packages.sh" | /bin/bash
# installing maven
RUN curl "https://raw.githubusercontent.com/denismakogon/openjdk-project-samples/master/scripts/install_maven.sh" | /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment