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

Commit fe29916

Browse files
committed
Update base image for Azure Functions Java 8
1 parent 5d4be31 commit fe29916

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
lines changed

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

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
44
#-------------------------------------------------------------------------------------------------------------
55

6-
FROM maven:3-jdk-8
6+
FROM mcr.microsoft.com/java/jdk:8u232-zulu-ubuntu
77

88
# Avoid warnings by switching to noninteractive
99
ENV DEBIAN_FRONTEND=noninteractive
@@ -16,6 +16,10 @@ ARG USERNAME=vscode
1616
ARG USER_UID=1000
1717
ARG USER_GID=$USER_UID
1818

19+
# Maven settings
20+
ARG MAVEN_VERSION=3.6.1
21+
ARG MAVEN_SHA=b4880fb7a3d81edd190a029440cdf17f308621af68475a4fe976296e71ff4a4b546dd6d8a58aaafba334d309cc11e638c52808a4b0e818fc0fd544226d952544
22+
1923
# Configure apt and install packages
2024
RUN apt-get update \
2125
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
@@ -29,17 +33,22 @@ RUN apt-get update \
2933
apt-transport-https \
3034
gnupg2 \
3135
lsb-release \
36+
#
37+
# Install Maven
38+
&& mkdir -p /usr/share/maven /usr/share/maven/ref \
39+
&& 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 \
40+
&& echo "${MAVEN_SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - \
41+
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
42+
&& rm -f /tmp/apache-maven.tar.gz \
43+
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn \
3244
#
3345
# Install Azure Functions, .NET Core, and Azure CLI
3446
&& echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \
35-
&& echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list \
47+
&& echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list \
3648
&& curl -sL https://packages.microsoft.com/keys/microsoft.asc | (OUT=$(apt-key add - 2>&1) || echo $OUT) \
3749
&& apt-get update \
3850
&& apt-get install -y azure-cli dotnet-sdk-2.1 azure-functions-core-tools \
3951
#
40-
# Allow for a consistant java home location for settings - image is changing over time
41-
&& if [ ! -d "/docker-java-home" ]; then ln -s "${JAVA_HOME}" /docker-java-home; fi \
42-
#
4352
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
4453
&& groupadd --gid $USER_GID $USERNAME \
4554
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
@@ -54,5 +63,10 @@ RUN apt-get update \
5463
&& rm -rf /var/lib/apt/lists/*
5564

5665

66+
ENV MAVEN_HOME /usr/share/maven
67+
ENV MAVEN_CONFIG /home/$USERNAME/.m2
68+
69+
COPY maven-settings.xml /usr/share/maven/ref/
70+
5771
# Switch back to dialog for any ad-hoc use of apt-get
58-
ENV DEBIAN_FRONTEND=
72+
ENV DEBIAN_FRONTEND=dialog

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// You can edit these settings after create using File > Preferences > Settings > Remote.
88
"settings": {
99
"terminal.integrated.shell.linux": "/bin/bash",
10-
"java.home": "/docker-java-home"
10+
"java.home": "/usr/lib/jvm/zulu-8-azure-amd64"
1111
},
1212

1313
// Uncomment the next line to run commands after the container is created.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
4+
https://maven.apache.org/xsd/settings-1.0.0.xsd">
5+
<localRepository>/usr/share/maven/ref/repository</localRepository>
6+
</settings>

0 commit comments

Comments
 (0)