diff --git a/5.3/Dockerfile b/5.3/Dockerfile new file mode 100644 index 00000000..03e18e6b --- /dev/null +++ b/5.3/Dockerfile @@ -0,0 +1,38 @@ +FROM java:openjdk-8u45-jdk + +MAINTAINER David Gageot + +ENV SONARQUBE_HOME /opt/sonarqube + +# Http port +EXPOSE 9000 + +# Database configuration +# Defaults to using H2 +ENV SONARQUBE_JDBC_USERNAME sonar +ENV SONARQUBE_JDBC_PASSWORD sonar +ENV SONARQUBE_JDBC_URL jdbc:h2:tcp://localhost:9092/sonar + +ENV SONAR_VERSION 5.3 + +# pub 2048R/D26468DE 2015-05-25 +# Key fingerprint = F118 2E81 C792 9289 21DB CAB4 CFCA 4A29 D264 68DE +# uid sonarsource_deployer (Sonarsource Deployer) +# sub 2048R/06855C1D 2015-05-25 +RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys F1182E81C792928921DBCAB4CFCA4A29D26468DE + +RUN set -x \ + && cd /opt \ + && curl -o sonarqube.zip -fSL https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-$SONAR_VERSION.zip \ + && curl -o sonarqube.zip.asc -fSL https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-$SONAR_VERSION.zip.asc \ + && gpg --verify sonarqube.zip.asc \ + && unzip sonarqube.zip \ + && mv sonarqube-$SONAR_VERSION sonarqube \ + && rm sonarqube.zip* \ + && rm -rf $SONARQUBE_HOME/bin/* + +VOLUME ["$SONARQUBE_HOME/data", "$SONARQUBE_HOME/extensions"] + +WORKDIR $SONARQUBE_HOME +COPY run.sh $SONARQUBE_HOME/bin/ +ENTRYPOINT ["./bin/run.sh"] diff --git a/5.3/run.sh b/5.3/run.sh new file mode 100755 index 00000000..53bb300f --- /dev/null +++ b/5.3/run.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -e + +if [ "${1:0:1}" != '-' ]; then + exec "$@" +fi + +exec java -jar lib/sonar-application-$SONAR_VERSION.jar \ + -Dsonar.log.console=true \ + -Dsonar.jdbc.username="$SONARQUBE_JDBC_USERNAME" \ + -Dsonar.jdbc.password="$SONARQUBE_JDBC_PASSWORD" \ + -Dsonar.jdbc.url="$SONARQUBE_JDBC_URL" \ + -Dsonar.web.javaAdditionalOpts="-Djava.security.egd=file:/dev/./urandom" \ + "$@" diff --git a/build.sh b/build.sh index 15dfadd7..961ce202 100755 --- a/build.sh +++ b/build.sh @@ -5,3 +5,4 @@ set -euo pipefail docker build -t sonarsource/sonar-4.5.6 4.5.6 docker build -t sonarsource/sonar-5.1.2 5.1.2 docker build -t sonarsource/sonar-5.2 5.2 +docker build -t sonarsource/sonar-5.3 5.3