Skip to content

Commit 9a11e79

Browse files
committed
initial commit
0 parents  commit 9a11e79

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM jboss/base-jdk:8
2+
MAINTAINER Erik Jacobs <erikmjacobs@gmail.com>
3+
4+
ENV SONAR_VERSION=5.5 \
5+
SONARQUBE_HOME=/opt/jboss/sonarqube
6+
7+
USER root
8+
EXPOSE 9000
9+
ADD root /
10+
RUN cd /tmp \
11+
&& curl -o sonarqube.zip -fSL https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-$SONAR_VERSION.zip \
12+
&& cd /opt/jboss \
13+
&& unzip /tmp/sonarqube.zip \
14+
&& mv sonarqube-$SONAR_VERSION sonarqube \
15+
&& rm /tmp/sonarqube.zip*
16+
COPY run.sh $SONARQUBE_HOME/bin/
17+
RUN /usr/bin/fix-permissions /opt/jboss/sonarqube \
18+
&& chmod 775 $SONARQUBE_HOME/bin/run.sh
19+
USER jboss
20+
WORKDIR $SONARQUBE_HOME
21+
ENTRYPOINT ["./bin/run.sh"]

root/usr/bin/fix-permissions

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
# Fix permissions on the given directory to allow group read/write of
3+
# regular files and execute of directories.
4+
chown -R jboss "$1"
5+
chgrp -R 0 "$1"
6+
chmod -R g+rw "$1"
7+
find "$1" -type d -exec chmod g+x {} +

run.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [ "${1:0:1}" != '-' ]; then
6+
exec "$@"
7+
fi
8+
9+
exec java -jar lib/sonar-application-$SONAR_VERSION.jar \
10+
-Dsonar.log.console=true \
11+
-Dsonar.jdbc.username="$SONARQUBE_JDBC_USERNAME" \
12+
-Dsonar.jdbc.password="$SONARQUBE_JDBC_PASSWORD" \
13+
-Dsonar.jdbc.url="$SONARQUBE_JDBC_URL" \
14+
-Dsonar.web.javaAdditionalOpts="$SONARQUBE_WEB_JVM_OPTS -Djava.security.egd=file:/dev/./urandom" \
15+
"$@"

0 commit comments

Comments
 (0)