-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile.native
22 lines (20 loc) · 1009 Bytes
/
Dockerfile.native
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Stage 1 : build with maven builder image with native capabilities
FROM quay.io/quarkus/centos-quarkus-maven:20.3.0-java11 AS build
COPY maven/pom.xml /usr/src/app/pom.xml
RUN mvn -f /usr/src/app/pom.xml -B de.qaware.maven:go-offline-maven-plugin:1.2.5:resolve-dependencies
COPY maven/src /usr/src/app/src
USER root
RUN chown -R quarkus /usr/src/app
USER quarkus
RUN mvn -f /usr/src/app/pom.xml -Pnative clean package -Dquarkus.package.type=native
## Source of libs
FROM debian:stable-slim AS lib-env
## Stage 2 : create the docker final image
FROM gcr.io/distroless/base
COPY --from=lib-env /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so.6
COPY --from=lib-env /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libz.so.1
COPY --from=lib-env /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/x86_64-linux-gnu/libgcc_s.so.1
COPY --from=build /usr/src/app/target/*-runner /work/application
WORKDIR /work
EXPOSE 8080
CMD ["./application", "-Dquarkus.http.host=0.0.0.0", "-Xmx64m"]