Skip to content

Commit 7a31c73

Browse files
committed
add native image
1 parent 2028440 commit 7a31c73

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

java/autonomousdb-wallet-secret-sample/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
<filtering>true</filtering>
111111
<includes>
112112
<include>Dockerfile</include>
113+
<include>Dockerfile.nativeimage</include>
113114
</includes>
114115
</resource>
115116
<resource>
@@ -159,4 +160,4 @@
159160
<version>21.3.0.0</version>
160161
</dependency>
161162
</dependencies>
162-
</project>
163+
</project>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM ghcr.io/graalvm/graalvm-ce:21.3.0
2+
RUN gu install native-image
3+
4+
RUN mkdir /app
5+
COPY libs /app/libs
6+
COPY ${project.artifactId}.jar /app
7+
8+
RUN native-image -jar /app/${project.artifactId}.jar -H:Name=/app/${project.artifactId}
9+
10+
FROM oraclelinux:8-slim
11+
RUN mkdir /app
12+
COPY --from=0 "/app/${project.artifactId}" /app/${project.artifactId}
13+
WORKDIR /app
14+
15+
# The driver will look for the wallet in folder /app/wallet
16+
# This value must match the one in the mountPath of the container
17+
# Reference in src/main/k8s/app.yaml
18+
19+
CMD ["/app/${project.artifactId}", \
20+
"-Doracle.net.tns_admin=/app/wallet", \
21+
"-Doracle.net.wallet_location=/app/wallet", \
22+
"-Doracle.jdbc.fanEnabled=false"]

0 commit comments

Comments
 (0)