Last active
May 13, 2022 18:21
-
-
Save linux-china/5c752dd127d2068aca4be64683049595 to your computer and use it in GitHub Desktop.
Build Docker image for JBang script with GraalVM native-image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM linuxchina/jbang-action:0.94.0-graal-java17-22.1.0 as builder | |
ARG mainClass="Hello2.java" | |
RUN mkdir -p /opt/app/out | |
WORKDIR /opt/app | |
COPY $mainClass /opt/app | |
RUN jbang export portable --native -O out/main $mainClass | |
#RUN upx -7 out/main | |
FROM paketobuildpacks/run:tiny-cnb | |
COPY --from=builder /opt/app/out /opt/app/out | |
ENTRYPOINT ["/opt/app/out/main"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment