Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit a9907c1

Browse files
committed
Move maven to /usr/local
1 parent a22d893 commit a9907c1

File tree

1 file changed

+5
-10
lines changed
  • containers/azure-functions-java-8/.devcontainer

1 file changed

+5
-10
lines changed

containers/azure-functions-java-8/.devcontainer/Dockerfile

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ ARG USER_GID=$USER_UID
1919
# Maven settings
2020
ARG MAVEN_VERSION=3.6.1
2121
ARG MAVEN_SHA=b4880fb7a3d81edd190a029440cdf17f308621af68475a4fe976296e71ff4a4b546dd6d8a58aaafba334d309cc11e638c52808a4b0e818fc0fd544226d952544
22+
ENV MAVEN_HOME=/usr/local/share/maven
23+
COPY maven-settings.xml ${MAVEN_HOME}/ref/
2224

2325
# Configure apt and install packages
2426
RUN apt-get update \
@@ -43,13 +45,12 @@ RUN apt-get update \
4345
&& chmod 0440 /etc/sudoers.d/$USERNAME \
4446
#
4547
# 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 \
4849
&& 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 \
4950
&& 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 \
5152
&& 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 \
5354
#
5455
# Install Azure Functions, .NET Core, and Azure CLI
5556
&& 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 \
6364
&& apt-get clean -y \
6465
&& rm -rf /var/lib/apt/lists/*
6566

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-
7267
# Switch back to dialog for any ad-hoc use of apt-get
7368
ENV DEBIAN_FRONTEND=dialog

0 commit comments

Comments
 (0)