|
| 1 | +FROM openjdk:8-alpine |
| 2 | + |
| 3 | +LABEL description="SonarQube integrated with Checkmarx SAST" |
| 4 | +LABEL maintainer="Alex Ivkin" |
| 5 | +LABEL version="1.1 alpha" |
| 6 | + |
| 7 | +ENV CX_PLUGIN_URL=https://download.checkmarx.com/8.7.0/Plugins/Sonar-8.70.1.zip |
| 8 | + |
| 9 | +ENV SONAR_VERSION=7.1 \ |
| 10 | + SONARQUBE_HOME=/opt/sonarqube \ |
| 11 | + # Database configuration |
| 12 | + # Defaults to using H2 |
| 13 | + SONARQUBE_JDBC_USERNAME=sonar \ |
| 14 | + SONARQUBE_JDBC_PASSWORD=sonar \ |
| 15 | + SONARQUBE_JDBC_URL= \ |
| 16 | + GPG_KEYS=F1182E81C792928921DBCAB4CFCA4A29D26468DE |
| 17 | + |
| 18 | +RUN set -x \ |
| 19 | + && apk add --no-cache gnupg unzip libressl wget su-exec bash curl \ |
| 20 | + && ( gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEYS" \ |
| 21 | + || gpg --keyserver pgp.mit.edu --recv-keys "$GPG_KEYS" \ |
| 22 | + || gpg --keyserver keyserver.pgp.com --recv-keys "$GPG_KEYS" ) \ |
| 23 | + && mkdir /opt \ |
| 24 | + && cd /opt \ |
| 25 | + && wget -O sonarqube.zip --no-verbose https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-$SONAR_VERSION.zip \ |
| 26 | + && wget -O sonarqube.zip.asc --no-verbose https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-$SONAR_VERSION.zip.asc \ |
| 27 | + && gpg --batch --verify sonarqube.zip.asc sonarqube.zip \ |
| 28 | + && unzip sonarqube.zip \ |
| 29 | + && mv sonarqube-$SONAR_VERSION sonarqube \ |
| 30 | + && addgroup -S sonarqube \ |
| 31 | + && adduser -S -G sonarqube sonarqube \ |
| 32 | + && chown -R sonarqube:sonarqube sonarqube \ |
| 33 | + && rm sonarqube.zip* \ |
| 34 | + && rm -rf $SONARQUBE_HOME/bin/* |
| 35 | + |
| 36 | +RUN set -eux \ |
| 37 | + && cd /opt/ \ |
| 38 | + && curl -L $CX_PLUGIN_URL --output cxplugin.zip \ |
| 39 | + && unzip -q cxplugin.zip -d $SONARQUBE_HOME/extensions/plugins/ \ |
| 40 | + && rm cxplugin.zip |
| 41 | + |
| 42 | +COPY run-sonarqube.sh $SONARQUBE_HOME/bin/ |
| 43 | +RUN chmod +x $SONARQUBE_HOME/bin/run-sonarqube.sh |
| 44 | + |
| 45 | +EXPOSE 9000 |
| 46 | +VOLUME "$SONARQUBE_HOME/data" |
| 47 | + |
| 48 | +WORKDIR $SONARQUBE_HOME |
| 49 | +ENTRYPOINT ["./bin/run-sonarqube.sh"] |
0 commit comments