@@ -19,6 +19,8 @@ ARG USER_GID=$USER_UID
19
19
# Maven settings
20
20
ARG MAVEN_VERSION=3.6.1
21
21
ARG MAVEN_SHA=b4880fb7a3d81edd190a029440cdf17f308621af68475a4fe976296e71ff4a4b546dd6d8a58aaafba334d309cc11e638c52808a4b0e818fc0fd544226d952544
22
+ ENV MAVEN_HOME=/usr/local/share/maven
23
+ COPY maven-settings.xml ${MAVEN_HOME}/ref/
22
24
23
25
# Configure apt and install packages
24
26
RUN apt-get update \
@@ -43,13 +45,12 @@ RUN apt-get update \
43
45
&& chmod 0440 /etc/sudoers.d/$USERNAME \
44
46
#
45
47
# Install Maven
46
- && mkdir -p /usr/share/maven /usr/share/maven/ref /home/${USERNAME}/.m2 \
47
- && chown $USER_UID:$USER_UID /home/${USERNAME}/.m2 \
48
+ && mkdir -p ${MAVEN_HOME} ${MAVEN_HOME}/ref \
48
49
&& curl -fsSL -o /tmp/apache-maven.tar.gz https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
49
50
&& echo "${MAVEN_SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - \
50
- && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
51
+ && tar -xzf /tmp/apache-maven.tar.gz -C ${MAVEN_HOME} --strip-components=1 \
51
52
&& rm -f /tmp/apache-maven.tar.gz \
52
- && ln -s /usr/share/maven/ bin/mvn /usr/bin/mvn \
53
+ && ln -s ${MAVEN_HOME}/ bin/mvn /usr/local /bin/mvn \
53
54
#
54
55
# Install Azure Functions, .NET Core, and Azure CLI
55
56
&& echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \
@@ -63,11 +64,5 @@ RUN apt-get update \
63
64
&& apt-get clean -y \
64
65
&& rm -rf /var/lib/apt/lists/*
65
66
66
-
67
- ENV MAVEN_HOME /usr/share/maven
68
- ENV MAVEN_CONFIG /home/$USERNAME/.m2
69
-
70
- COPY maven-settings.xml /usr/share/maven/ref/
71
-
72
67
# Switch back to dialog for any ad-hoc use of apt-get
73
68
ENV DEBIAN_FRONTEND=dialog
0 commit comments