Skip to content

Instantly share code, notes, and snippets.

@watsh-rajneesh
Created March 2, 2017 07:38
Show Gist options
  • Save watsh-rajneesh/cfb5b12e41ba150c892318e567adaffa to your computer and use it in GitHub Desktop.
Save watsh-rajneesh/cfb5b12e41ba150c892318e567adaffa to your computer and use it in GitHub Desktop.
Dockerize Java Application
# Use this base image for JDK 8
# You can even use this image to set up maven and build from source the fat jar
# that you will execute below.
# See this for setting up maven - https://runnable.com/docker/java/dockerize-your-java-application
FROM sjsucohort6/oracle-java:8
MAINTAINER Watsh Rajneesh <watsh.rajneesh@sjsu.edu>
WORKDIR /slackbot
# Use maven-shade-plugin to create a fat jar of your application which runs as a service
# see my gist on slackbot for example pom.xml or google it up.
ADD ./target/slackbot-1.0-SNAPSHOT.jar /slackbot
CMD ["java", "-jar", "slackbot-1.0-SNAPSHOT.jar"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment