diff --git a/.devcontainer/server/Dockerfile b/.devcontainer/server/Dockerfile index 39a25fe..fe1e08f 100644 --- a/.devcontainer/server/Dockerfile +++ b/.devcontainer/server/Dockerfile @@ -1,16 +1,30 @@ -FROM mcr.microsoft.com/openjdk/jdk:21-ubuntu +ARG VARIANT=21-jdk +FROM eclipse-temurin:${VARIANT} -# Set build arguments for username, UID, and GID -ARG USERNAME=java -ARG USER_UID=1000 -ARG USER_GID=1000 +RUN apt-get update \ + && apt-get -y install --no-install-recommends \ + ca-certificates \ + git \ + nano \ + vim-tiny \ + && apt-get auto-remove -y \ + && apt-get clean -y \ + && chsh -s $(which bash) ubuntu \ + && echo 'export PS1="\e[01;32m\u\e[m:\e[01;34m\w\e[m\$ "' >> /home/ubuntu/.bashrc -# Create the user and group with the specified UID and GID -RUN groupadd --gid $USER_GID $USERNAME \ - && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME +ENV MAVEN_HOME=/opt/maven +ENV PATH=$MAVEN_HOME/bin:$PATH + +ARG MAVEN_VERSION=3.9.10 +ARG BASE_URL=https://dlcdn.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries + +RUN mkdir -p $MAVEN_HOME \ + && 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 $MAVEN_HOME --strip-components=1 \ + && rm -f /tmp/apache-maven.tar.gz # Set the default user -USER $USERNAME +USER ubuntu # Set the working directory -WORKDIR /home/$USERNAME +WORKDIR /home/ubuntu diff --git a/.devcontainer/server/devcontainer.json b/.devcontainer/server/devcontainer.json index 176cf59..9c7f3f3 100644 --- a/.devcontainer/server/devcontainer.json +++ b/.devcontainer/server/devcontainer.json @@ -3,12 +3,6 @@ "build": { "dockerfile": "Dockerfile", }, - "features": { - "ghcr.io/devcontainers/features/java:1": { - "installMaven": "true" - }, - "ghcr.io/devcontainers/features/git:1": {} - }, "containerEnv": { "GIT_REPO_URL": "https://scm.vilanet.fr/kriss/slot" },