Agnostic docker image to run sonar-scanner-cli-4.7.0.2747?

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube 9.0.2 /sonar-scanner-cli-4.7.0.2747
  • what are you trying to achieve
    We currently have repos in the company that are developed in several languages like Python , go , typescript.
    we have build docker image per languages for running sonarqube-scanner but i guess this is hard to mantain updated since we have to keep updated each docker image changing language version.
    example a docker image for python that we have built is below , and the same for other two languages but changing the docker image for nodejs etc:
    touch Dockerfile

cat >>Dockerfile <<END_DOCKER
FROM python:3.7-buster
RUN python3.7 -m pip install --upgrade pip tox --no-cache-dir
RUN apt-get update && apt-get install shellcheck && apt-get clean
RUN curl https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.7.0.2747-linux.zip > sonarqube.zip
&& unzip sonarqube.zip
&& rm sonarqube.zip
ENV SONARQUBE_HOME sonar-scanner-4.7.0.2747-linux
RUN mkdir /home/build
WORKDIR /home/build
END_DOCKER

what I am would like to know if there is some docker image that is agnostic to the language , that allow us to have just one image that works for all repos.

  • what have you tried so far to achieve this

it was described above answer

Hi,

Have you tried to use the offical docker image from Docker Hub?

You don’t need an image with Python to analyze Python code, or an image with Go to analyze Go code and the official image already contains a nodejs installation required for TypeScript analysis.

1 Like

thanks very much Felipe , i will test it and will let you now