-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.static.linking
30 lines (28 loc) · 1.11 KB
/
Dockerfile.static.linking
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM dekstroza/graalvm-ce:20.2.0-r11-libmuslc as graalvm
ARG JAR_FILE
ARG BUILD_DIR
ADD ${BUILD_DIR}/${JAR_FILE} /home/app/mongonaut.jar
WORKDIR /home/app
RUN native-image --no-server \
--static \
--libc=musl \
--enable-http \
--enable-https \
--no-fallback \
--enable-all-security-services \
-H:+StackTrace \
-H:+JNI \
-H:-SpawnIsolates \
--initialize-at-run-time="io.micronaut.configuration.mongo.reactive.test.AbstractMongoProcessFactory, \
com.mongodb.UnixServerAddress,com.mongodb.internal.connection.SnappyCompressor, \
io.micronaut.tracing.brave.BraveTracerFactory, \
io.micronaut.tracing.brave.instrument.http.HttpTracingFactory, \
io.micronaut.tracing.brave.log.Slf4jCurrentTraceContextFactory, \
io.micronaut.tracing.brave.sender.HttpClientSenderFactory, \
io.micronaut.tracing.instrument.rxjava.RxJava1TracingInstrumentation" \
--initialize-at-build-time=io.micrometer.core,io.micrometer.prometheus,io.micrometer.shaded.org.pcollections \
--class-path /home/app/mongonaut.jar
FROM scratch
EXPOSE 8080
COPY --from=graalvm /home/app/mongonaut .
ENTRYPOINT ["./mongonaut"]