-
Notifications
You must be signed in to change notification settings - Fork 10
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
30 changed files
with
1,510 additions
and
8 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
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
Submodule spring-boot-webserver
deleted from
f2326b
18 changes: 18 additions & 0 deletions
18
native-image/spring-boot-webserver/.mvn/wrapper/maven-wrapper.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar |
9 changes: 9 additions & 0 deletions
9
native-image/spring-boot-webserver/Dockerfile.debian-slim.uber-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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM container-registry.oracle.com/graalvm/jdk:23 AS build | ||
COPY . /webserver | ||
WORKDIR /webserver | ||
RUN ./mvnw clean package | ||
|
||
FROM gcr.io/distroless/java21-debian12 | ||
COPY --from=build /webserver/target/webserver-0.0.1-SNAPSHOT.jar webserver-0.0.1-SNAPSHOT.jar | ||
EXPOSE 8080 | ||
ENTRYPOINT ["java", "-jar", "webserver-0.0.1-SNAPSHOT.jar"] |
4 changes: 4 additions & 0 deletions
4
native-image/spring-boot-webserver/Dockerfile.distroless-base.mostly
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM gcr.io/distroless/base-debian12 | ||
COPY target/webserver.mostly-static / | ||
EXPOSE 8080 | ||
ENTRYPOINT ["/webserver.mostly-static"] |
4 changes: 4 additions & 0 deletions
4
native-image/spring-boot-webserver/Dockerfile.distroless-java-base.dynamic
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM gcr.io/distroless/java-base-debian12 | ||
COPY target/webserver / | ||
EXPOSE 8080 | ||
ENTRYPOINT ["/webserver"] |
4 changes: 4 additions & 0 deletions
4
native-image/spring-boot-webserver/Dockerfile.distroless-java-base.dynamic-optimized
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM gcr.io/distroless/java-base-debian12 | ||
COPY target/webserver.dynamic-optimized / | ||
EXPOSE 8080 | ||
ENTRYPOINT ["/webserver.dynamic-optimized"] |
22 changes: 22 additions & 0 deletions
22
native-image/spring-boot-webserver/Dockerfile.distroless-java-base.jlink
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM container-registry.oracle.com/graalvm/jdk:23 AS build | ||
COPY . /webserver | ||
WORKDIR /webserver | ||
RUN ./mvnw clean package | ||
RUN ./mvnw dependency:build-classpath -Dmdep.outputFile=cp.txt | ||
RUN jdeps --ignore-missing-deps -q --recursive --multi-release 23 --print-module-deps --class-path $(cat cp.txt) target/webserver-0.0.1-SNAPSHOT.jar | ||
RUN jlink \ | ||
--module-path ${JAVA_HOME}/jmods \ | ||
--add-modules java.base,java.compiler,java.desktop,java.instrument,java.management,java.naming,java.net.http,java.prefs,java.rmi,java.scripting,java.security.jgss,java.sql,jdk.jfr,jdk.unsupported,org.graalvm.nativeimage \ | ||
--verbose \ | ||
--strip-debug \ | ||
--compress zip-9 \ | ||
--no-header-files \ | ||
--no-man-pages \ | ||
--strip-java-debug-attributes \ | ||
--output jlink-jre | ||
|
||
FROM gcr.io/distroless/java-base-debian12 | ||
COPY --from=build /webserver/target/webserver-0.0.1-SNAPSHOT.jar webserver-0.0.1-SNAPSHOT.jar | ||
COPY --from=build /webserver/jlink-jre jlink-jre | ||
EXPOSE 8080 | ||
ENTRYPOINT ["jlink-jre/bin/java", "-jar", "webserver-0.0.1-SNAPSHOT.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM scratch | ||
WORKDIR /tmp | ||
COPY target/webserver.static / | ||
EXPOSE 8080 | ||
ENTRYPOINT ["/webserver.static"] |
5 changes: 5 additions & 0 deletions
5
native-image/spring-boot-webserver/Dockerfile.scratch.static-upx
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM scratch | ||
WORKDIR /tmp | ||
COPY target/webserver.static-upx / | ||
EXPOSE 8080 | ||
ENTRYPOINT ["/webserver.static-upx"] |
Oops, something went wrong.