Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
spring-app [docker in a nutshell]
# use openjdk 16 image
FROM openjdk:16
# copy the jar from host to container
ADD target/spring-app.jar app/spring-app.jar
# make app default directory for the upcoming commands
WORKDIR /app
# expose port 8080
EXPOSE 8080
# when container starts execute: java -jar spring-app.jar
ENTRYPOINT ["java", "-jar", "spring-app.jar"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment