-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
27 lines (19 loc) · 810 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
# Use maven to compile the java application.
FROM docker.io/maven AS build-env
# Set the working directory to /app
WORKDIR /app
# copy the pom.xml file to download dependencies
COPY pom.xml ./
# download dependencies as specified in pom.xml
# building dependency layer early will speed up compile time when pom is unchanged
RUN mvn verify --fail-never
# Copy the rest of the working directory contents into the container
COPY . ./
# Compile the application.
RUN mvn -Dmaven.test.skip=true package
# Build runtime image.
FROM openjdk:8-jre-alpine
# Copy the compiled files over.
COPY --from=build-env /app/target/ /app/
# Starts java app with debugging server at port 5005.
CMD ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005,quiet=y", "-jar", "/app/hello-world-1.0.0.jar"]