Skip to content

Instantly share code, notes, and snippets.

@adamw
Created June 6, 2014 08:09
Show Gist options
  • Save adamw/166b82ec04c9c0f67453 to your computer and use it in GitHub Desktop.
Save adamw/166b82ec04c9c0f67453 to your computer and use it in GitHub Desktop.

Revisions

  1. adamw created this gist Jun 6, 2014.
    20 changes: 20 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    # VERSION 1.0

    # the base image is a trusted ubuntu build with java 7 (https://index.docker.io/u/dockerfile/java/)
    FROM dockerfile/java

    # that's me!
    MAINTAINER Adam Warski, [email protected]

    # we need this because the workdir is modified in dockerfile/java
    WORKDIR /

    # run the (java) server as the daemon user
    USER daemon

    # copy the locally built fat-jar to the image
    ADD target/myapp-assembly-1.0-deps.jar /app/deps.jar
    ADD target/myapp-assembly-1.0.jar /app/app.jar

    # run the server when a container based on this image is being run
    ENTRYPOINT [ "java", "-cp", "/app/deps.jar:/app/app.jar" ]