Reputation: 61
I'm running sonarqube in a docker container using this compose docker file: docker-compose
I want to add an external plugin (jar file). I couldn't manage to do so. Any ideas?
Upvotes: 3
Views: 2635
Reputation: 6477
Just copy your jars to your local folder "sonarqube_extensions/plugins" which should exist next to your docker-compose.yml file and they will be linked into your container according to your referenced docker-compose.yml file.
Old answer
You can modify your existing docker-compose.yml file. Assuming your jar files are located in a folder named "external_jars" next to the compose file and you want these jars to be available inside the container under, for example, /opt/sonarqube/external_jars
(I am not familiar with sonarQube and I do not know how the correct structure should look like). Then you can add one line to this excerpt of your compose file:
sonarqube:
image: sonarqube
ports:
- "9000:9000"
networks:
- sonarnet
environment:
- SONARQUBE_JDBC_URL=jdbc:postgresql://db:5432/sonar
volumes:
- external_jars:/opt/sonarqube/external_jars # <-- Added this line
- sonarqube_conf:/opt/sonarqube/conf
- sonarqube_data:/opt/sonarqube/data
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_bundled-plugins:/opt/sonarqube/lib/bundled-plugins
Or you just add the jars locally into the folder "sonarqube_extensions" if this is the correct folder. I do not know what you want to achieve, therefore I can only guess what you are trying.
"Volumes" are linked folders between your local machine (which is running the docker engine) and the container. The syntax "sonarqube_extensions:/opt/sonarqube/extensions" means: map the contents of "sonarqube_extensions" of the local machine to the container and make it accessible at the path "/opt/sonarqube/extensions".
Upvotes: 3