Unable to retrieve Product UUID for SonarQube Container

Must-share information (formatted with Markdown):

  • which versions are you using : 10.0.0.68432
  • how is SonarQube deployed: Docker
  • what are you trying to achieve: Trying to retrieve the UUID from the Container so that we can use that to uniquely Identify the Container and use it as a licensing for our Sonarqube Plugin
  • what have you tried so far to achieve this: Tried running the below command directly in Sonarqube Container:
    docker exec <<CONTAINER_ID>> cat /sys/class/dmi/id/product_uuid

Hi,

Could you explain further? Because your SonarQube license is unrelated to your container ID.

 
Ann

Hi @ganncamp

We have a Custom SonarQube Plugin which we have monetized using a Node Locked Licensing Scheme. We are trying to retrieve the UUID of the container in which SonarQube is running to use that as an identifier for our license to be validated against the Plugin when any analysis is run using that Plugin.

Cheers,
Anudit

Hello @Anudit , thanks a lot for taking the time to participate in the community.

With our docker images, we are trying to move toward implementing all best practices, which include having the smallest set of permissions for the user running the SonarQube process.

With /sys/class/dmi/id/product_uuid not being a functional dependency of SonarQube, we will not change the permission model of that file.

If that is a strict requirement for you, i suggest you extend our Docker image to build your own.

Regards,
Jeremy.

Hi Jeremy,

Pardon my ignorance here but could yoi please help me understand how I can override the base set of permissions given by sonarqubr docker image in our own image.

Is it as simple as including your image in ours and iverriding the standard err and standard out permissions in my image thus allowing a user to utilize the product uuid without impacting the functionality or features given by sonarsource based sonarqube image?

Regards,
Anudit

Hey @Anudit,

Your second sentence is right, it should not require more than that. Nonetheless, you will have to distribute that new image to your customers.

For the technical part here is the beginning of the documentation about multi-stage and extending images.

Please let me know if that solve your issue.

Regards,
Jeremy.