Skip to content

Commit

Permalink
Split pom.xml and source code copy to avoid unnecessary dependency re…
Browse files Browse the repository at this point in the history
…solving/downloading
  • Loading branch information
caspervg committed Jul 7, 2016
1 parent 0d43285 commit 46c33bb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion template/java/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@ RUN apt-get update \
&& mkdir -p /app \
&& mkdir -p /usr/src/app

# Copy the POM-file first, for separate dependency resolving and downloading
ONBUILD COPY pom.xml /usr/src/app
ONBUILD RUN cd /usr/src/app \
&& mvn dependency:resolve
ONBUILD RUN cd /usr/src/app \
&& mvn verify

# Copy the source code and build the application
ONBUILD COPY . /usr/src/app
ONBUILD RUN cd /usr/src/app \
&& mvn clean package

CMD ["/bin/bash", "/template.sh"]
CMD ["/bin/bash", "/template.sh"]

0 comments on commit 46c33bb

Please sign in to comment.