-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
40 additions
and
21 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,21 @@ LABEL maintainer="Sascha Möllering <[email protected]>" | |
|
||
# First step: build java runtime module | ||
|
||
RUN wget https://www-eu.apache.org/dist/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz -P /tmp | ||
RUN tar xf /tmp/apache-maven-3.6.1-bin.tar.gz -C /opt | ||
RUN ln -s /opt/apache-maven-3.6.1 /opt/maven | ||
|
||
ENV M2_HOME=/opt/maven | ||
ENV MAVEN_HOME=/opt/maven | ||
ENV PATH=${M2_HOME}/bin:${PATH} | ||
|
||
COPY ./pom.xml ./pom.xml | ||
COPY src ./src/ | ||
|
||
ENV MAVEN_OPTS='-Xmx6g' | ||
|
||
RUN mvn -Dmaven.test.skip=true clean package | ||
|
||
RUN set -ex && \ | ||
apt-get update && apt-get install -y wget unzip && \ | ||
wget https://d3pxv6yz143wms.cloudfront.net/11.0.3.7.1/amazon-corretto-11.0.3.7.1-linux-x64.tar.gz -nv && \ | ||
|
@@ -23,20 +38,19 @@ RUN /opt/jdk/bin/jlink \ | |
FROM debian:9-slim | ||
LABEL maintainer="Sascha Möllering <[email protected]>" | ||
|
||
RUN mkdir /opt/app && apt-get update && apt-get install curl -y | ||
|
||
COPY --from=builder /opt/jdk-minimal /opt/jdk-minimal | ||
COPY --from=build target/target/reactive-vertx-1.6-fat.jar /opt/app | ||
|
||
ENV JAVA_HOME=/opt/jdk-minimal | ||
ENV PATH="$PATH:$JAVA_HOME/bin" | ||
|
||
RUN mkdir /opt/app && apt-get update && apt-get install curl -y | ||
|
||
COPY target/reactive-vertx-1.5-fat.jar /opt/app | ||
|
||
HEALTHCHECK --interval=5s --timeout=3s --retries=3 \ | ||
CMD curl -f http://localhost:8080/health/check || exit 1 | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["java", "-server", "-XX:+DoEscapeAnalysis", "-XX:+UseStringDeduplication", \ | ||
"-XX:+UseCompressedOops", "-XX:+UseG1GC", \ | ||
"-jar", "opt/app/reactive-vertx-1.5-fat.jar"] | ||
"-jar", "opt/app/reactive-vertx-1.5-fat.jar"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
FROM oracle/graalvm-ce:1.0.0-rc16 AS build-aot | ||
FROM oracle/graalvm-ce:19.1.0 AS build-aot | ||
|
||
RUN yum update -y | ||
RUN yum install wget -y | ||
RUN yum clean all && yum update -y && yum install wget -y | ||
|
||
RUN wget https://www-eu.apache.org/dist/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz -P /tmp | ||
RUN tar xf /tmp/apache-maven-3.6.1-bin.tar.gz -C /opt | ||
RUN ln -s /opt/apache-maven-3.6.1 /opt/maven | ||
RUN ln -s /opt/graalvm-ce-1.0.0-rc16 /opt/graalvm | ||
RUN ln -s /opt/graalvm-ce-19.1.0 /opt/graalvm | ||
|
||
ENV GRAALVM_HOME=/opt/graalvm | ||
ENV JAVA_HOME=/opt/graalvm | ||
|
@@ -20,6 +19,8 @@ COPY src ./src/ | |
|
||
ENV MAVEN_OPTS='-Xmx6g' | ||
|
||
RUN gu install native-image | ||
|
||
RUN mvn -Dmaven.test.skip=true -Pnative-image-fargate clean package | ||
|
||
FROM debian:9-slim | ||
|
@@ -28,7 +29,7 @@ LABEL maintainer="Sascha Möllering <[email protected]>" | |
ENV javax.net.ssl.trustStore /cacerts | ||
ENV javax.net.ssl.trustAnchors /cacerts | ||
|
||
RUN apt-get update && apt-get install -y curl | ||
RUN apt-get update && apt-get install curl -y | ||
COPY --from=build-aot target/reactive-vertx /usr/bin/reactive-vertx | ||
COPY --from=build-aot /opt/graalvm/jre/lib/amd64/libsunec.so /libsunec.so | ||
COPY --from=build-aot /opt/graalvm/jre/lib/security/cacerts /cacerts | ||
|
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
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
8 changes: 5 additions & 3 deletions
8
...rc/main/resources/META-INF/native-image/com.amazon/reactive-vertx/native-image.properties
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
Args = --rerun-class-initialization-at-runtime=io.netty.handler.codec.http2.Http2CodecUtil \ | ||
--enable-url-protocols=http,https --enable-all-security-services \ | ||
--delay-class-initialization-to-runtime=io.netty.handler.codec.http.HttpObjectEncoder,io.netty.handler.codec.http2.DefaultHttp2FrameWriter,io.netty.handler.codec.http.websocketx.WebSocket00FrameEncoder \ | ||
Args = --enable-url-protocols=http,https --enable-all-security-services \ | ||
--static \ | ||
--verbose \ | ||
--report-unsupported-elements-at-runtime \ | ||
--initialize-at-build-time=org.slf4j.LoggerFactory,io.netty.util.internal.MathUtil,io.netty.util.internal.PlatformDependent0,io.netty.util.internal.PlatformDependent,io.netty.util.CharsetUtil,software.amazon.awssdk.protocols.core.StringToValueConverter$SimpleStringToValue,io.netty.util.AsciiString,io.netty.handler.codec.http2.Http2CodecUtil,io.netty.handler.codec.http.HttpObjectEncoder,io.netty.handler.codec.http2.DefaultHttp2FrameWriter,io.netty.handler.codec.http.websocketx.WebSocket00FrameEncoder \ | ||
-H:IncludeResources=(META-INF|vertx-default-jul-logging)/.* \ | ||
-H:ReflectionConfigurationFiles=classes/${.}/reflection.json |