Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to set the sonar web context by environment #17

Closed
rschlick opened this issue Jan 18, 2016 · 10 comments
Closed

Ability to set the sonar web context by environment #17

rschlick opened this issue Jan 18, 2016 · 10 comments
Assignees

Comments

@rschlick
Copy link

Hi,

I need to change the default web context of sonar to /sonar. Is it possible to set this value through an docker environment variable ?

Thanks,

Romain Schlick

@rschlick rschlick changed the title Abilities to set the sonar web context by environment Ability to set the sonar web context by environment Jan 18, 2016
@rschlick
Copy link
Author

I have proposed a pull request, but I don't have access on your repository.
I have clone your repository and push the commit on my repository here:
https://github.com/rschlick/docker-sonar

In Dockerfile I have added:

ENV SONARQUBE_WEB_CONTEXT /

And in run.sh (in the exec java commands):

-Dsonar.web.context="$SONARQUBE_WEB_CONTEXT" \

@Godin Godin added the question label Jan 18, 2016
@Godin
Copy link
Member

Godin commented Mar 10, 2016

sonar.web.context has been removed in SonarQube version 5.4 - see https://jira.sonarsource.com/browse/SONAR-7122

@Godin Godin added wontfix and removed question labels Mar 10, 2016
@Godin Godin closed this as completed Mar 10, 2016
@tobilarscheid
Copy link

tobilarscheid commented Apr 28, 2016

I vote for reopening this, as the web context will be added in sonar 5.5 again!

https://jira.sonarsource.com/browse/SONAR-7494

@Godin
Copy link
Member

Godin commented Apr 28, 2016

@tobilarscheid could you please check #22 - in comparison with this request it introduces more generic variable which can be used to specify various options via sonar.web.javaAdditionalOpts and not just context, and in comparison with #20 it allows to pass it without removal of current default value -Djava.security.egd=file:/dev/./urandom. This looks to me as cleanest solution, if it covers this need, then no pb to merge it.

@Godin Godin self-assigned this Apr 28, 2016
@Godin Godin removed the wontfix label Apr 28, 2016
@Godin Godin added this to the in-progress milestone Apr 28, 2016
@Godin Godin reopened this Apr 28, 2016
@tobilarscheid
Copy link

Yes, I think #22 is a clean solution!

@Godin
Copy link
Member

Godin commented May 2, 2016

Closed in preference to #22

@Godin Godin closed this as completed May 2, 2016
@Godin Godin removed this from the in-progress milestone May 2, 2016
@Godin
Copy link
Member

Godin commented May 4, 2016

In fact SONARQUBE_WEB_JVM_OPTS (#22) doesn't work for sonar.web.*, however without any modifications, i.e. even for older images (e.g. 5.3), you can do

docker run -p 9000:9000 -it sonarqube:5.3 -Dsonar.web.context=/sq

arguments specified for docker run are passed to jvm. Thus, is there any benefits in addition of environment variable to specify the same?

@islisava
Copy link

islisava commented Jun 29, 2017

Hi!
I am trying to change 'sonar.web.context' property within Dockerfile (as ENV property) or docker-compose.yml (as environment property):

ENV sonar.web.context /sonarqube
or
ENV JAVA_OPTS -Dsonar.web.context=/sonarqube

Is there a way to make it work?
Or do I do something wrong?

@Godin
Copy link
Member

Godin commented Jun 29, 2017

@IrishkA13 there is no such variables sonar.web.context and JAVA_OPTS, so that why it doesn't work. As explained in #17 (comment) just above your comment, you can do:

docker run -p 9000:9000 -it sonarqube -Dsonar.web.context=/sonarqube

and equivalent of this in a docker-compose notation:

version: "2"

services:
  sonarqube:
    image: sonarqube
    command: -Dsonar.web.context=/sonarqube
    ports:
      - "9000:9000"

@islisava
Copy link

@Godin thanks a lot for reply!

@SonarSource SonarSource locked as resolved and limited conversation to collaborators Jan 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants