-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docker file to install Maven and Gradle
- Loading branch information
Showing
3 changed files
with
34 additions
and
4 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,11 +1,37 @@ | ||
FROM jeanblanchard/java:serverjre-8 | ||
MAINTAINER JunHo Yoon "[email protected]" | ||
|
||
RUN apk update; apk add curl bash | ||
RUN apk update; apk add curl bash tar | ||
|
||
ARG MAVEN_VERSION=3.6.3 | ||
ARG MAVEN_DOWNLOAD_BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries | ||
|
||
ARG GRADLE_VERSION=6.7.1 | ||
ARG GRADLE_DOWNLOAD_BASE_URL=https://services.gradle.org/distributions | ||
|
||
# Install maven | ||
RUN mkdir -p /usr/share/maven \ | ||
&& echo "Downloading maven" \ | ||
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${MAVEN_DOWNLOAD_BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \ | ||
&& echo "Unziping maven" \ | ||
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \ | ||
&& rm -f /tmp/apache-maven.tar.gz | ||
|
||
# Install gradle | ||
RUN mkdir -p /usr/share/gradle \ | ||
&& echo "Downloading gradle" \ | ||
&& curl -fsSL -o /tmp/gradle.zip ${GRADLE_DOWNLOAD_BASE_URL}/gradle-${GRADLE_VERSION}-bin.zip \ | ||
&& echo "Unziping gradle" \ | ||
&& unzip -d /usr/share/gradle /tmp/gradle.zip \ | ||
&& rm -f /tmp/gradle.zip | ||
|
||
# Set up environment variables | ||
ENV BASE_DIR=/opt \ | ||
NGRINDER_HOME=/opt/ngrinder-controller | ||
NGRINDER_HOME=/opt/ngrinder-controller \ | ||
MAVEN_HOME=/usr/share/maven \ | ||
GRADLE_HOME=/usr/share/gradle/gradle-${GRADLE_VERSION} | ||
|
||
ENV PATH=$PATH:$GRADLE_HOME/bin:$MAVEN_HOME/bin | ||
|
||
# Expose ports | ||
EXPOSE 80 16001 12000-12009 | ||
|
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,3 +1,7 @@ | ||
#!/usr/bin/env bash | ||
echo "wait a while extracting war files... It takes time for the first run." | ||
echo "Installed build tools." | ||
mvn -version | ||
gradle -version | ||
|
||
echo "Wait a while extracting war files... It takes time for the first run." | ||
java -jar ${BASE_DIR}/ngrinder-*.war --port 80 |
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