Dockerfile to install maven
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
# | |
# Oracle Java 7 Dockerfile | |
# | |
# https://github.com/dockerfile/java | |
# https://github.com/dockerfile/java/tree/master/oracle-java7 | |
# | |
# Pull base image. | |
FROM alpine as build | |
ARG MAVEN_VERSION=3.6.3 | |
ARG USER_HOME_DIR="/root" | |
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries | |
# Install Java. | |
RUN apk --update --no-cache add openjdk7 curl | |
RUN mkdir -p /usr/share/maven /usr/share/maven/ref \ | |
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \ | |
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \ | |
&& rm -f /tmp/apache-maven.tar.gz \ | |
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn | |
ENV MAVEN_HOME /usr/share/maven | |
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2" | |
# Define working directory. | |
WORKDIR /data | |
# Define commonly used JAVA_HOME variable | |
ENV JAVA_HOME /usr/lib/jvm/default-jvm/ | |
# Define default command. | |
CMD ["mvn", "--version"] | |
# Spring docker sample | |
# FROM openjdk:8-jdk-alpine | |
# VOLUME /tmp | |
# ARG JAR_FILE | |
# COPY ${JAR_FILE} app.jar | |
# ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] |
@LuanComputacao @antonTroyan you need to update the version defined of MVN to at least 3.6.3. See available versions on remote at: https://apache.osuosl.org/maven/maven-3/
Thanks, @zerjioang
I did the update!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Step 8/13 : RUN mkdir -p /usr/share/maven /usr/share/maven/ref && curl -fsSL -o /tmp/apache-maven.tar.gz${BASE_URL}/apache-maven-$ {MAVEN_VERSION}-bin.tar.gz && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 && rm -f /tmp/apache-maven.tar.gz && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
---> Running in 6117c95afa87
curl: (22) The requested URL returned error: 404 Not Found