forked from vulhub/vulhub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use maven image instead of downloading
- Loading branch information
Showing
1 changed file
with
13 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
FROM maven:3-jdk-7 AS builder | ||
|
||
MAINTAINER phithon <[email protected]> | ||
|
||
COPY ./ /usr/src/ | ||
|
||
WORKDIR /usr/src | ||
|
||
RUN cd /usr/src; \ | ||
mvn -U clean package -Dmaven.test.skip=true | ||
|
||
FROM vulhub/java:7u21-jdk | ||
|
||
LABEL MAINTAINER="b1ngz <[email protected]>" | ||
|
||
COPY . /usr/src | ||
|
||
RUN set -ex \ | ||
&& mkdir -p /opt/maven \ | ||
&& wget -qO- http://www-us.apache.org/dist/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz | tar zx -C /opt/maven --strip-components=1 \ | ||
&& update-alternatives --install /usr/bin/mvn mvn /opt/maven/bin/mvn 100 \ | ||
&& cd /usr/src \ | ||
&& mvn -U clean package -Dmaven.test.skip=true | ||
COPY --from=builder /usr/src/target/jackson.jar /jackson.jar | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["java", "-jar", "/usr/src/target/jackson.jar"] | ||
CMD ["java", "-jar", "/jackson.jar"] |