From aa9c6e47cce760637db54e5dc3c8504a2836d01d Mon Sep 17 00:00:00 2001 From: Grzegorz Siewruk Date: Fri, 20 Sep 2024 13:52:18 +0200 Subject: [PATCH] mvn pip and gradle in docker for cdxbom --- backend/Dockerfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 6172bce..4fe0ea2 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -14,7 +14,7 @@ WORKDIR /app # Copy the built JAR file from the previous stage to the container COPY --from=maven_build /app/target/MixewayFlowAPI-0.0.1-SNAPSHOT.jar flowapi.jar -# Install dependencies and Node.js +# Install dependencies, Node.js, Maven, Python, and pip RUN apt-get update && \ apt-get install -y curl && \ curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ @@ -23,6 +23,9 @@ RUN apt-get update && \ unzip \ git \ nodejs \ + maven \ + python3 \ + python3-pip \ && apt-get clean # Install cdxgen globally @@ -46,6 +49,15 @@ RUN wget -O jdk22.tar.gz https://download.oracle.com/java/22/latest/jdk-22_linux ENV JAVA_HOME=/usr/local/jdk-22 ENV PATH="$JAVA_HOME/bin:$PATH" +# Install Gradle +ENV GRADLE_VERSION=8.4 +RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -P /tmp \ + && unzip /tmp/gradle-${GRADLE_VERSION}-bin.zip -d /opt/gradle \ + && rm /tmp/gradle-${GRADLE_VERSION}-bin.zip +ENV GRADLE_HOME=/opt/gradle/gradle-${GRADLE_VERSION} +ENV PATH="$PATH:$GRADLE_HOME/bin" + + RUN mkdir /opt/kics RUN mkdir /opt/dtrack COPY --from=kics /app/bin/kics /usr/local/bin/kics