Install Sonar client with embedded JRE on alpine

I am using alpine
When i install Sonar client Linux version during execution i am faced with:
/sonar-scanner- not found

I know it is possible to set sonar to use external JRE but i do not want to.
I do want to use the JRE that is coming with sonar itself, how can i make it work on alpine systems?


Alright, seems installing gcompat made it possible to use sonar-linux on alpine, something you should consider adding to documentation imho

1 Like

Hello @Denys_Andriyanov ,

Thank you for the feedback on the problem you encountered.

Could you please give us more information about your use case for running the sonar-scanner on Alpine Linux?
Is it the main OS of the machine you are working on or are you trying to run the sonar-scanner in a docker container? Did you consider using sonar-scanner-cli-docker ?


Hi, I need to run the sonar client in the alpine image. I am running sonar client in gitlab ci
The Docker client solution is not fit for my case, but the workaround i mentioned works fine.
Just try it yourself, get sonar client and try to run it in an alpine image

Hi, I encountered the same problem and your suggestion does indeed help to make the embedded java work.
Unfortunately this error appears now:

RUN sonar-scanner -h:
#22 0.392 Error occurred during initialization of VM
#22 0.392 Unable to load native library: Error loading shared library No such file or directory (needed by /sonar-scanner/jre/lib/

Did you have anything similar? Using the latest alpine image as well.

If anyone needs, this was fixed by adding symlinks such as:

ln -s /sonar-scanner/bin/sonar-scanner /bin/sonar-scanner
ln -s /sonar-scanner/jre/lib/server/ /sonar-scanner/jre/lib
1 Like