mirror of
https://github.com/jlengrand/helidon-jereleaser.git
synced 2026-03-10 08:21:22 +00:00
30 lines
779 B
Docker
30 lines
779 B
Docker
|
|
# 1st stage, build the app
|
|
FROM helidon/jdk11-graalvm-maven:21.0.0 as build
|
|
|
|
WORKDIR /helidon
|
|
|
|
# Create a first layer to cache the "Maven World" in the local repository.
|
|
# Incremental docker builds will always resume after that, unless you update
|
|
# the pom
|
|
ADD pom.xml .
|
|
RUN mvn package -Pnative-image -Dnative.image.skip -Dmaven.test.skip -Declipselink.weave.skip
|
|
|
|
# Do the Maven build!
|
|
# Incremental docker builds will resume here when you change sources
|
|
ADD src src
|
|
RUN mvn package -Pnative-image -Dnative.image.buildStatic -DskipTests
|
|
|
|
RUN echo "done!"
|
|
|
|
# 2nd stage, build the runtime image
|
|
FROM scratch
|
|
WORKDIR /helidon
|
|
|
|
# Copy the binary built in the 1st stage
|
|
COPY --from=build /helidon/target/helidon-quickstart-se .
|
|
|
|
ENTRYPOINT ["./helidon-quickstart-se"]
|
|
|
|
EXPOSE 8080
|