Skip to content

Instantly share code, notes, and snippets.

@linux-china
Created May 13, 2022 17:56
Show Gist options
  • Select an option

  • Save linux-china/928e0cd4022b560ebe1a36aa7af58db3 to your computer and use it in GitHub Desktop.

Select an option

Save linux-china/928e0cd4022b560ebe1a36aa7af58db3 to your computer and use it in GitHub Desktop.

Revisions

  1. linux-china created this gist May 13, 2022.
    16 changes: 16 additions & 0 deletions Dockerfle
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    FROM linuxchina/jbang-action as builder

    ARG mainClass="Hello2.java"

    RUN mkdir -p /opt/app/out
    WORKDIR /opt/app

    COPY $mainClass /opt/app

    RUN jbang export portable -O out/app.jar $mainClass

    FROM eclipse-temurin:17

    COPY --from=builder /opt/app/out /opt/app/out

    CMD ["java", "-jar", "/opt/app/out/app.jar"]