-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.native
43 lines (28 loc) · 1.26 KB
/
Dockerfile.native
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
32
33
34
35
36
37
38
39
40
41
42
43
# syntax=docker/dockerfile:experimental
FROM oracle/graalvm-ce:19.3.2-java11 AS builder
RUN yum install wget -y
RUN wget https://archive.apache.org/dist/maven/maven-3/3.6.2/binaries/apache-maven-3.6.2-bin.tar.gz -O - | tar xz -C /opt
RUN ln -s /opt/apache-maven-3.6.2 /opt/maven \
&& ln -s /opt/graalvm-ce-java11-19.3.2 /opt/graalvm
RUN gu install native-image
ENV JAVA_HOME=/opt/graalvm
ENV M2_HOME=/opt/maven
ENV MAVEN_HOME=/opt/maven
ENV PATH=${M2_HOME}/bin:${PATH}
ENV PATH=${JAVA_HOME}/bin:${PATH}
WORKDIR project
ARG PROFILE=local
COPY pom.xml pom.xml
RUN --mount=type=cache,target=/root/.m2 mvn -Puber-jar,native -f pom.xml -B de.qaware.maven:go-offline-maven-plugin:1.2.5:resolve-dependencies
COPY src src
COPY etc/checkstyle etc/checkstyle
COPY etc/spotbugs etc/spotbugs
RUN --mount=type=cache,target=/root/.m2 mvn -Dquarkus.profile=${PROFILE} -Puber-jar,native clean package
COPY etc/wrapper-docker-native.sh etc/wrapper-docker-native.sh
FROM ubuntu:18.04
COPY --from=builder /project/target/comet-watcher-runner .
COPY --from=builder /project/etc/wrapper-docker-native.sh .
COPY --from=builder /opt/graalvm/lib/security/cacerts cacerts
RUN apt-get update && apt-get install -y curl
RUN ["chmod", "+x", "wrapper-docker-native.sh"]
CMD ["./wrapper-docker-native.sh"]