-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
28 lines (26 loc) · 866 Bytes
/
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
FROM amazoncorretto:11 AS builder
RUN yum install -y tar gzip
RUN mkdir /opt/maven && \
cd /opt/maven && \
curl -L "https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.tar.gz" | tar -xzv --strip-components=1
ENV M2_HOME=/opt/maven
WORKDIR /build
COPY . .
RUN $M2_HOME/bin/mvn clean package
FROM amazoncorretto:11
WORKDIR /app
COPY --from=builder /build/application/target/*.jar app.jar
FROM amazoncorretto:11 AS builder
RUN yum install -y tar gzip
RUN mkdir /opt/maven && \
cd /opt/maven && \
curl -L "https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.tar.gz" | tar -xzv --strip-components=1
ENV M2_HOME=/opt/maven
WORKDIR /build
COPY . .
RUN $M2_HOME/bin/mvn clean package
FROM amazoncorretto:11
WORKDIR /app
COPY --from=builder /build/application/target/*.jar app.jar
COPY start.sh .
CMD ["./start.sh"]