Skip to content

Instantly share code, notes, and snippets.

@martinklepsch
Created May 20, 2014 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinklepsch/293dfb90e1a4a4d813bd to your computer and use it in GitHub Desktop.
Save martinklepsch/293dfb90e1a4a4d813bd to your computer and use it in GitHub Desktop.
Dockerfile does not work without setting workdir even if all file references are absolute
FROM dockerfile/java
# copy the locally built fat-jar to the image
ADD app.jar /
EXPOSE 42042
# run the server when a container based on this image is being run
ENTRYPOINT [ "java", "-verbose", "-jar", "/app.jar" ]
### hangs after printing "[Opened /usr/lib/jvm/java-7-oracle/jre/lib/rt.jar]"
### note that this is only because running the jar with "-verbose"
### otherwise there would be no output
FROM dockerfile/java
WORKDIR /
# copy the locally built fat-jar to the image
ADD app.jar /
EXPOSE 42042
# run the server when a container based on this image is being run
ENTRYPOINT [ "java", "-verbose", "-jar", "/app.jar" ]
### CORRECTLY RUNS THE JAR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment