forked from dji-sdk/DJI-Cloud-API-Demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
29 lines (24 loc) · 1.15 KB
/
Dockerfile
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
# Build Stage
FROM maven:latest AS build
COPY src /home/app/src
COPY pom.xml /home/app
RUN apt-get update
RUN apt-get install software-properties-common wget ca-certificates curl gnupg apt-utils -y
RUN wget -O- https://apt.corretto.aws/corretto.key | apt-key add -
RUN add-apt-repository 'deb https://apt.corretto.aws stable main'
RUN apt-get update
RUN apt-get install -y java-21-amazon-corretto-jdk
RUN export JAVA_HOME=/usr/lib/jvm/java-21-amazon-corretto
RUN mvn -f /home/app/pom.xml clean package
# Execution Stage
FROM debian:bookworm
COPY --from=build /home/app/target/cloud-api-sample-1.7.0.jar /usr/local/lib/cloud-api-sample-1.7.0.jar
RUN apt-get update
RUN apt-get install software-properties-common wget ca-certificates curl gnupg apt-utils -y
RUN wget -O- https://apt.corretto.aws/corretto.key | apt-key add -
RUN add-apt-repository 'deb https://apt.corretto.aws stable main'
RUN apt-get update
RUN apt-get install -y java-21-amazon-corretto-jdk
RUN export JAVA_HOME=/usr/lib/jvm/java-21-amazon-corretto
EXPOSE 8080
ENTRYPOINT ["/usr/lib/jvm/java-21-amazon-corretto/bin/java","-jar","/usr/local/lib/cloud-api-sample-1.7.0.jar"]