-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Conversation
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/ |
Is it conceivable that users are currently doing something like the following? (which would be broken by the FROM sonarqube:x.y.z
COPY config-bits $SONARQUBE_HOME/conf |
@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? |
The general rule we follow is that you should have a volume for where the application stores data (so The reason for this is that, once defined, Docker has no means of " 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). |
Even |
(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 |
@tianon regarding |
@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:
|
@dhoer your comment https://github.com/SonarSource/docker-sonarqube/issues/16#issuecomment-256426270 was way before addition of volumes for |
Sounds sane to me!
|
Although I would like all volumes including 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 |
…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.
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.
@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 |
@tianon updated this PR. And thank you for the help! |
👍 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 |
LGTM Build test of #2437; ded1a3f ( $ 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
|
No description provided.