forked from stein-solutions/java-knative-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile.native
More file actions
31 lines (21 loc) · 716 Bytes
/
Copy pathdockerfile.native
File metadata and controls
31 lines (21 loc) · 716 Bytes
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
31
# Using Oracle GraalVM for JDK 17
FROM ghcr.io/graalvm/native-image-community:23-muslib AS builder
# Install gzip
RUN microdnf install gzip
# Set the working directory to /home/app
WORKDIR /build
# Copy the source code into the image for building
COPY . /build
# Build
RUN ./mvnw --no-transfer-progress -e native:compile -Pnative
RUN chmod +x /build/target/demo
# The deployment Image
FROM ubuntu:jammy
# # # Install necessary runtime dependencies
# RUN apt-get update && \
# apt-get install -y --no-install-recommends libc6 && \
# apt-get clean
EXPOSE 8080
# Copy the native executable into the containers
COPY --from=builder /build/target/demo /usr/local/bin/app
ENTRYPOINT ["/usr/local/bin/app"]