Created
May 20, 2014 22:21
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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