diff --git a/images/Dockerfile.sonarscan b/images/Dockerfile.sonarscan index d90380c..9a31e79 100644 --- a/images/Dockerfile.sonarscan +++ b/images/Dockerfile.sonarscan @@ -1,7 +1,18 @@ FROM node:22.17.1 ENV NODE_VERSION 22.17.1 +ENV SONAR_SCANNER_VERSION=4.7.0.2747 +ENV SONAR_SCANNER_HOME=/opt/sonar-scanner +ENV PATH="${SONAR_SCANNER_HOME}/bin:${PATH}" -RUN npm install -g sonarqube-scanner@3.0.0 +RUN apt-get update \ + && apt-get install -y --no-install-recommends ca-certificates curl unzip \ + && rm -rf /var/lib/apt/lists/* -RUN npm install -ignore-scripts -g lcov-result-merger \ No newline at end of file +RUN curl -fsSL "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip" -o /tmp/sonar-scanner.zip \ + && unzip /tmp/sonar-scanner.zip -d /opt \ + && mv "/opt/sonar-scanner-${SONAR_SCANNER_VERSION}-linux" "${SONAR_SCANNER_HOME}" \ + && rm /tmp/sonar-scanner.zip \ + && sonar-scanner --version + +RUN npm install --ignore-scripts -g lcov-result-merger