Skip to content

Commit

Permalink
Adds Dockerfile that gets the supervisor out of the picture
Browse files Browse the repository at this point in the history
  • Loading branch information
scottopell committed Jul 31, 2023
1 parent 72a3923 commit 6e32b6e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tools/misbehaving-jmx-server/Dockerfile.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use the official Maven image as the base image
FROM maven:latest AS build

# Set the working directory to /app
WORKDIR /app

# Copy the pom.xml file and install the dependencies
COPY pom.xml .
RUN mvn dependency:resolve

# Copy the source code and build the JAR file
COPY src/ /app/src/
RUN mvn clean package assembly:single

RUN ls /app/target

# Use the official OpenJDK image as the base image for the final image
FROM openjdk:latest AS final

# Set the working directory to /app
WORKDIR /app

# Copy the JAR file from the Maven image to the final image
COPY --from=build /app/target/misbehavingjmxserver-1.0-SNAPSHOT-jar-with-dependencies.jar .

# Run the supervisor class from the jar
CMD ["java", "-cp", "misbehavingjmxserver-1.0-SNAPSHOT-jar-with-dependencies.jar", "org.datadog.misbehavingjmxserver.App"]

0 comments on commit 6e32b6e

Please sign in to comment.