Skip to content

Instantly share code, notes, and snippets.

@dehidehidehi
Created October 2, 2023 12:57
Show Gist options
  • Save dehidehidehi/2eaaa6013a12f6b3743e0f81a28c796e to your computer and use it in GitHub Desktop.
Save dehidehidehi/2eaaa6013a12f6b3743e0f81a28c796e to your computer and use it in GitHub Desktop.
Dockerfile with Java and remote debugger attached.
FROM openjdk:20
EXPOSE 9090
EXPOSE 9091
EXPOSE 9092
COPY /target/${project_name}-*.jar /app/app.jar
WORKDIR /app
# Enable remote debugging
ENTRYPOINT java \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:9091 \
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=9092 \
-jar /app/app.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment