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

SonarQube 5.6.4 (LTS) and 6.2 (LATEST) #2437

Merged
merged 1 commit into from
Dec 13, 2016
Merged

Conversation

Godin
Copy link
Contributor

@Godin Godin commented Dec 12, 2016

No description provided.

@tianon
Copy link
Member

tianon commented Dec 12, 2016

warning: insecure protocol git:// detected: git://github.com/SonarSource/docker-sonarqube
diff --git a/sonarqube_5.6.3-alpine/Dockerfile b/sonarqube_5.6.4-alpine/Dockerfile
similarity index 90%
rename from sonarqube_5.6.3-alpine/Dockerfile
rename to sonarqube_5.6.4-alpine/Dockerfile
index 2a81314..8c9ca4e 100644
--- a/sonarqube_5.6.3-alpine/Dockerfile
+++ b/sonarqube_5.6.4-alpine/Dockerfile
@@ -2,7 +2,7 @@ FROM java:8-alpine
 
 MAINTAINER David Gageot <david.gageot@sonarsource.com>
 
-ENV SONAR_VERSION=5.6.3 \
+ENV SONAR_VERSION=5.6.4 \
     SONARQUBE_HOME=/opt/sonarqube \
     # Database configuration
     # Defaults to using H2
@@ -32,7 +32,7 @@ RUN set -x \
     && rm sonarqube.zip* \
     && rm -rf $SONARQUBE_HOME/bin/*
 
-VOLUME ["$SONARQUBE_HOME/data", "$SONARQUBE_HOME/extensions"]
+VOLUME ["$SONARQUBE_HOME/data", "$SONARQUBE_HOME/extensions", "$SONARQUBE_HOME/conf", "$SONARQUBE_HOME/logs"]
 
 WORKDIR $SONARQUBE_HOME
 COPY run.sh $SONARQUBE_HOME/bin/
diff --git a/sonarqube_5.6.3-alpine/run.sh b/sonarqube_5.6.4-alpine/run.sh
similarity index 100%
rename from sonarqube_5.6.3-alpine/run.sh
rename to sonarqube_5.6.4-alpine/run.sh
diff --git a/sonarqube_5.6.3/Dockerfile b/sonarqube_5.6.4/Dockerfile
similarity index 89%
rename from sonarqube_5.6.3/Dockerfile
rename to sonarqube_5.6.4/Dockerfile
index 9b536aa..4206947 100644
--- a/sonarqube_5.6.3/Dockerfile
+++ b/sonarqube_5.6.4/Dockerfile
@@ -2,7 +2,7 @@ FROM java:8
 
 MAINTAINER David Gageot <david.gageot@sonarsource.com>
 
-ENV SONAR_VERSION=5.6.3 \
+ENV SONAR_VERSION=5.6.4 \
     SONARQUBE_HOME=/opt/sonarqube \
     # Database configuration
     # Defaults to using H2
@@ -30,7 +30,7 @@ RUN set -x \
     && rm sonarqube.zip* \
     && rm -rf $SONARQUBE_HOME/bin/*
 
-VOLUME ["$SONARQUBE_HOME/data", "$SONARQUBE_HOME/extensions"]
+VOLUME ["$SONARQUBE_HOME/data", "$SONARQUBE_HOME/extensions", "$SONARQUBE_HOME/conf", "$SONARQUBE_HOME/logs"]
 
 WORKDIR $SONARQUBE_HOME
 COPY run.sh $SONARQUBE_HOME/bin/
diff --git a/sonarqube_5.6.3/run.sh b/sonarqube_5.6.4/run.sh
similarity index 100%
rename from sonarqube_5.6.3/run.sh
rename to sonarqube_5.6.4/run.sh
diff --git a/sonarqube_6.1-alpine/Dockerfile b/sonarqube_6.1-alpine/Dockerfile
index f488066..7ba93aa 100644
--- a/sonarqube_6.1-alpine/Dockerfile
+++ b/sonarqube_6.1-alpine/Dockerfile
@@ -32,7 +32,7 @@ RUN set -x \
     && rm sonarqube.zip* \
     && rm -rf $SONARQUBE_HOME/bin/*
 
-VOLUME ["$SONARQUBE_HOME/data", "$SONARQUBE_HOME/extensions"]
+VOLUME ["$SONARQUBE_HOME/data", "$SONARQUBE_HOME/extensions", "$SONARQUBE_HOME/conf", "$SONARQUBE_HOME/logs"]
 
 WORKDIR $SONARQUBE_HOME
 COPY run.sh $SONARQUBE_HOME/bin/
diff --git a/sonarqube_6.1/Dockerfile b/sonarqube_6.1/Dockerfile
index 277338f..6257596 100644
--- a/sonarqube_6.1/Dockerfile
+++ b/sonarqube_6.1/Dockerfile
@@ -30,7 +30,7 @@ RUN set -x \
     && rm sonarqube.zip* \
     && rm -rf $SONARQUBE_HOME/bin/*
 
-VOLUME ["$SONARQUBE_HOME/data", "$SONARQUBE_HOME/extensions"]
+VOLUME ["$SONARQUBE_HOME/data", "$SONARQUBE_HOME/extensions", "$SONARQUBE_HOME/conf", "$SONARQUBE_HOME/logs"]
 
 WORKDIR $SONARQUBE_HOME
 COPY run.sh $SONARQUBE_HOME/bin/

@tianon
Copy link
Member

tianon commented Dec 12, 2016

Is it conceivable that users are currently doing something like the following? (which would be broken by the VOLUME-ization of $SONARQUBE_HOME/conf)

FROM sonarqube:x.y.z
COPY config-bits $SONARQUBE_HOME/conf

@Godin
Copy link
Contributor Author

Godin commented Dec 12, 2016

@tianon potentially could be... in fact story with volumes is not clear (at least to me): there are requests from users to add them (see https://github.com/SonarSource/docker-sonarqube/issues/44 and SonarSource/docker-sonarqube#56) and there are even requests to remove existed ones (see https://github.com/SonarSource/docker-sonarqube/issues/16#issuecomment-256426270). So maybe you can advise?

@tianon
Copy link
Member

tianon commented Dec 12, 2016

The general rule we follow is that you should have a volume for where the application stores data (so $SONARQUBE_HOME/data is uncontestably appropriate), but configuration is almost never appropriate in a volume (unless it's specifically managed by the application itself at runtime and never supplied/managed manually by users, or there is an easy way to override the default in the image).

The reason for this is that, once defined, Docker has no means of "UNVOLUME" -- thus, once a volume, always a volume.

Logs are a bit more iffy -- those are probably appropriate for having in a volume if it's really necessary for the application to log on-disk (rather than simply using Docker's built-in logging mechanism via stdio).

@tianon
Copy link
Member

tianon commented Dec 12, 2016

Even $SONARQUBE_HOME/extensions is kind of iffy -- how are extensions installed? via a web interface, or can they be installed manually by copying into that directory?

@tianon
Copy link
Member

tianon commented Dec 12, 2016

(ie, would it be useful for me as a user to be able to bake my own image based off this one which is pre-configured or includes several extensions installed by default -- if the answer is "yes", as it often is, then a VOLUME is inappropriate and breaks the ability to do so)

@Godin
Copy link
Contributor Author

Godin commented Dec 12, 2016

@tianon regarding $SONARQUBE_HOME/extensions without Docker technically both options are available - either copy manually, either via web interface.

@dhoer
Copy link

dhoer commented Dec 12, 2016

@tianon You summed up the problem nicely. I ended up just coping sonar Dockerfile removing the volumes, copying in local conf files, and writing log to stdout:

RUN ln -s /dev/stdout $SONARQUBE_HOME/logs/access.log && ln -s /dev/stderr $SONARQUBE_HOME/logs/sonar.log
WORKDIR $SONARQUBE_HOME
COPY run.sh $SONARQUBE_HOME/bin/
COPY conf $SONARQUBE_HOME/conf/
ENTRYPOINT ["./bin/run.sh"]

@Godin
Copy link
Contributor Author

Godin commented Dec 12, 2016

@dhoer your comment https://github.com/SonarSource/docker-sonarqube/issues/16#issuecomment-256426270 was way before addition of volumes for logs and conf, so was about existing data and extensions, while here in your example nothing about them. So could you please clarify?

@Godin
Copy link
Contributor Author

Godin commented Dec 13, 2016

I guess main concern was about existing volume for extensions.

So summarizing all this: @tianon @dhoer what about revert of changes for conf and logs and removal of extensions, keeping only declaration of volume for data in Dockerfile?

@tianon
Copy link
Member

tianon commented Dec 13, 2016 via email

@dhoer
Copy link

dhoer commented Dec 13, 2016

Although I would like all volumes including data to be up to the user to configure, I can live with this.

It would be nice to include an example of calling docker and docker-compose with extension, conf, and logs volumes:

docker run -d --name sonarqube \
    -v $(pwd)/conf:/opt/sonarqube/conf \
    -v $(pwd)/extensions:/opt/sonarqube/extensions \
    -v $(pwd)/logs:/opt/sonarqube/logs \
    -p 9000:9000 -p 9092:9092 \
    -e SONARQUBE_JDBC_USERNAME=sonar \
    -e SONARQUBE_JDBC_PASSWORD=sonar \
    -e SONARQUBE_JDBC_URL=jdbc:postgresql://localhost/sonar \
    sonarqube 

Example docker-compose.yml

version: '2'
services:
  sonarqube:
    image: sonarqube
    environment:
      - SONARQUBE_JDBC_USERNAME=sonar
      - SONARQUBE_JDBC_PASSWORD=sonar
      - SONARQUBE_JDBC_URL=jdbc:postgresql://localhost/sonar
    volumes:
      - ./conf:/opt/sonarqube/conf
      - ./extensions:/opt/sonarqube/extensions
      - ./logs:/opt/sonarqube/logs
    ports:
      - 9000:9000
      - 9002:9002
    depends_on:
      - db
  db:
    image: postgres
    environment:
      - POSTGRES_PASSWORD=sonar
      - POSTGRES_USER=sonar
    ports:
      - 5432:5432

Godin added a commit to SonarSource/docker-sonarqube that referenced this pull request Dec 13, 2016
…ctories

Explicit declaration of volume is appropriate only for data stored by
application, volume for configurable things is almost never appropriate
(see docker-library/official-images#2437).

This reverts commit 69fca2e.
And additionally removes declaration of volume for "extensions" directory.
Godin added a commit to SonarSource/docker-sonarqube that referenced this pull request Dec 13, 2016
Explicit declaration of volume is appropriate only for data stored by
application, volume for configurable things is almost never appropriate
(see docker-library/official-images#2437).

This reverts commit 69fca2e.
And additionally removes declaration of volume for "extensions" directory.
@Godin
Copy link
Contributor Author

Godin commented Dec 13, 2016

@dhoer applied - SonarSource/docker-sonarqube@80366e3

Regarding documentation: Maybe I'll have time to work on this. But as was already said in https://github.com/SonarSource/docker-sonarqube/issues/16#issuecomment-195110224 - pull-requests with changes for documentation are welcome. Also should be noted that example docker-compose.yml with volumes already exists at https://github.com/SonarSource/docker-sonarqube/blob/master/recipes.md and reference to it from Docker Hub exists.

@Godin
Copy link
Contributor Author

Godin commented Dec 13, 2016

@tianon updated this PR. And thank you for the help!

@Godin Godin changed the title SonarQube 5.6.4 SonarQube 5.6.4 (LTS) and 6.2 (LATEST) Dec 13, 2016
@tianon
Copy link
Member

tianon commented Dec 13, 2016

👍 update diff:

warning: insecure protocol git:// detected: git://github.com/SonarSource/docker-sonarqube
diff --git a/sonarqube_6.1-alpine/Dockerfile b/sonarqube_5.6.4-alpine/Dockerfile
similarity index 93%
rename from sonarqube_6.1-alpine/Dockerfile
rename to sonarqube_5.6.4-alpine/Dockerfile
index f488066..6571156 100644
--- a/sonarqube_6.1-alpine/Dockerfile
+++ b/sonarqube_5.6.4-alpine/Dockerfile
@@ -2,7 +2,7 @@ FROM java:8-alpine
 
 MAINTAINER David Gageot <david.gageot@sonarsource.com>
 
-ENV SONAR_VERSION=6.1 \
+ENV SONAR_VERSION=5.6.4 \
     SONARQUBE_HOME=/opt/sonarqube \
     # Database configuration
     # Defaults to using H2
@@ -32,7 +32,7 @@ RUN set -x \
     && rm sonarqube.zip* \
     && rm -rf $SONARQUBE_HOME/bin/*
 
-VOLUME ["$SONARQUBE_HOME/data", "$SONARQUBE_HOME/extensions"]
+VOLUME "$SONARQUBE_HOME/data"
 
 WORKDIR $SONARQUBE_HOME
 COPY run.sh $SONARQUBE_HOME/bin/
diff --git a/sonarqube_6.1-alpine/run.sh b/sonarqube_5.6.4-alpine/run.sh
similarity index 100%
rename from sonarqube_6.1-alpine/run.sh
rename to sonarqube_5.6.4-alpine/run.sh
diff --git a/sonarqube_6.1/Dockerfile b/sonarqube_5.6.4/Dockerfile
similarity index 93%
rename from sonarqube_6.1/Dockerfile
rename to sonarqube_5.6.4/Dockerfile
index 277338f..c1b7219 100644
--- a/sonarqube_6.1/Dockerfile
+++ b/sonarqube_5.6.4/Dockerfile
@@ -2,7 +2,7 @@ FROM java:8
 
 MAINTAINER David Gageot <david.gageot@sonarsource.com>
 
-ENV SONAR_VERSION=6.1 \
+ENV SONAR_VERSION=5.6.4 \
     SONARQUBE_HOME=/opt/sonarqube \
     # Database configuration
     # Defaults to using H2
@@ -30,7 +30,7 @@ RUN set -x \
     && rm sonarqube.zip* \
     && rm -rf $SONARQUBE_HOME/bin/*
 
-VOLUME ["$SONARQUBE_HOME/data", "$SONARQUBE_HOME/extensions"]
+VOLUME "$SONARQUBE_HOME/data"
 
 WORKDIR $SONARQUBE_HOME
 COPY run.sh $SONARQUBE_HOME/bin/
diff --git a/sonarqube_6.1/run.sh b/sonarqube_5.6.4/run.sh
similarity index 100%
rename from sonarqube_6.1/run.sh
rename to sonarqube_5.6.4/run.sh
diff --git a/sonarqube_5.6.3-alpine/Dockerfile b/sonarqube_6.2-alpine/Dockerfile
similarity index 93%
rename from sonarqube_5.6.3-alpine/Dockerfile
rename to sonarqube_6.2-alpine/Dockerfile
index 2a81314..f0401f5 100644
--- a/sonarqube_5.6.3-alpine/Dockerfile
+++ b/sonarqube_6.2-alpine/Dockerfile
@@ -2,7 +2,7 @@ FROM java:8-alpine
 
 MAINTAINER David Gageot <david.gageot@sonarsource.com>
 
-ENV SONAR_VERSION=5.6.3 \
+ENV SONAR_VERSION=6.2 \
     SONARQUBE_HOME=/opt/sonarqube \
     # Database configuration
     # Defaults to using H2
@@ -32,7 +32,7 @@ RUN set -x \
     && rm sonarqube.zip* \
     && rm -rf $SONARQUBE_HOME/bin/*
 
-VOLUME ["$SONARQUBE_HOME/data", "$SONARQUBE_HOME/extensions"]
+VOLUME "$SONARQUBE_HOME/data"
 
 WORKDIR $SONARQUBE_HOME
 COPY run.sh $SONARQUBE_HOME/bin/
diff --git a/sonarqube_5.6.3-alpine/run.sh b/sonarqube_6.2-alpine/run.sh
similarity index 100%
rename from sonarqube_5.6.3-alpine/run.sh
rename to sonarqube_6.2-alpine/run.sh
diff --git a/sonarqube_5.6.3/Dockerfile b/sonarqube_6.2/Dockerfile
similarity index 93%
rename from sonarqube_5.6.3/Dockerfile
rename to sonarqube_6.2/Dockerfile
index 9b536aa..10b6879 100644
--- a/sonarqube_5.6.3/Dockerfile
+++ b/sonarqube_6.2/Dockerfile
@@ -2,7 +2,7 @@ FROM java:8
 
 MAINTAINER David Gageot <david.gageot@sonarsource.com>
 
-ENV SONAR_VERSION=5.6.3 \
+ENV SONAR_VERSION=6.2 \
     SONARQUBE_HOME=/opt/sonarqube \
     # Database configuration
     # Defaults to using H2
@@ -30,7 +30,7 @@ RUN set -x \
     && rm sonarqube.zip* \
     && rm -rf $SONARQUBE_HOME/bin/*
 
-VOLUME ["$SONARQUBE_HOME/data", "$SONARQUBE_HOME/extensions"]
+VOLUME "$SONARQUBE_HOME/data"
 
 WORKDIR $SONARQUBE_HOME
 COPY run.sh $SONARQUBE_HOME/bin/
diff --git a/sonarqube_5.6.3/run.sh b/sonarqube_6.2/run.sh
similarity index 100%
rename from sonarqube_5.6.3/run.sh
rename to sonarqube_6.2/run.sh

@tianon
Copy link
Member

tianon commented Dec 13, 2016

LGTM

Build test of #2437; ded1a3f (sonarqube):

$ bashbrew build sonarqube:latest
warning: insecure protocol git:// detected: git://github.com/SonarSource/docker-sonarqube
Building bashbrew/cache:b73f32b00076a8cd1c52fa185a6e2bab6ac7f37d67fc8b8f2917294778d6cbcc (sonarqube:latest)
Tagging sonarqube:latest
Tagging sonarqube:6.2

$ test/run.sh sonarqube:latest
testing sonarqube:latest
	'utc' [1/4]...passed
	'cve-2014--shellshock' [2/4]...passed
	'no-hard-coded-passwords' [3/4]...passed
	'override-cmd' [4/4]...passed


$ bashbrew build sonarqube:lts
Building bashbrew/cache:ea3579d401a913db34945ef24bfee6faf965ab4834c982524a482b26c603b17c (sonarqube:lts)
Tagging sonarqube:lts
Tagging sonarqube:5.6.4

$ test/run.sh sonarqube:lts
testing sonarqube:lts
	'utc' [1/4]...passed
	'cve-2014--shellshock' [2/4]...passed
	'no-hard-coded-passwords' [3/4]...passed
	'override-cmd' [4/4]...passed


$ bashbrew build sonarqube:alpine
Building bashbrew/cache:746ba7fc57cc8678da91737dc78d6e0bf3e977374cb31c6234d22b7e1442735a (sonarqube:alpine)
Tagging sonarqube:alpine
Tagging sonarqube:6.2-alpine

$ test/run.sh sonarqube:alpine
testing sonarqube:alpine
	'utc' [1/4]...passed
	'cve-2014--shellshock' [2/4]...passed
	'no-hard-coded-passwords' [3/4]...passed
	'override-cmd' [4/4]...passed


$ bashbrew build sonarqube:lts-alpine
Building bashbrew/cache:cf52f4351f0a264dd4630269640f0f33157f012558718426671dfa24ef4b4d30 (sonarqube:lts-alpine)
Tagging sonarqube:lts-alpine
Tagging sonarqube:5.6.4-alpine

$ test/run.sh sonarqube:lts-alpine
testing sonarqube:lts-alpine
	'utc' [1/4]...passed
	'cve-2014--shellshock' [2/4]...passed
	'no-hard-coded-passwords' [3/4]...passed
	'override-cmd' [4/4]...passed

@tianon tianon merged commit ee3eab0 into docker-library:master Dec 13, 2016
@Godin Godin deleted the sonarqube branch December 13, 2016 23:16
mmoqui added a commit to Silverpeas/docker-silverpeas-prod that referenced this pull request Jan 3, 2017
@yosifkit yosifkit mentioned this pull request Feb 11, 2017
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants