forked from jenkinsci/custom-distribution-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (20 loc) · 876 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
29
30
31
# Start with a base image containing Java runtime
FROM maven:3.6.0-jdk-8-alpine AS MAVEN_BUILD
# Add Maintainer Info
LABEL maintainer="[email protected]"
# Creates a build directory in the image and copies the pom.xml into it
COPY pom.xml /build/
# Copies the src directory into the build directory in the image.
COPY src /build/src/
# Copies the config directory into the build directory in the image.
COPY config /build/config/
# Set Workdir
WORKDIR /build/
# Runs the mvn package command to compile and package the application as an executable JAR
RUN mvn clean package spring-boot:repackage
FROM maven:3.6.0-jdk-8-alpine
# Create a new working directory in the image called /app
WORKDIR /app
COPY --from=MAVEN_BUILD /build/target/custom-distribution-service-0.0.1.jar /app/
RUN ls
ENTRYPOINT ["java", "-jar", "/app/custom-distribution-service-0.0.1.jar"]