forked from OpenShiftDemos/sonarqube-openshift-docker
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from asanchezr/master
Use upstream/official SonarQube 8 image
- Loading branch information
Showing
5 changed files
with
38 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,14 @@ | ||
FROM jboss/base-jdk:11 | ||
FROM sonarqube:8-community | ||
|
||
MAINTAINER Erik Jacobs <[email protected]> | ||
MAINTAINER Siamak Sadeghianfar <[email protected]> | ||
MAINTAINER Roland Stens ([email protected]) | ||
MAINTAINER Wade Barnes ([email protected]) | ||
MAINTAINER Emiliano Sune ([email protected]) | ||
|
||
# Define Plug-in Versions | ||
ARG SONAR_ZAP_PLUGIN_VERSION=1.2.0 | ||
|
||
ENV SONAR_VERSION=7.9.1 \ | ||
SONARQUBE_HOME=/opt/sonarqube \ | ||
SONARQUBE_JDBC_USERNAME=sonar \ | ||
SONARQUBE_JDBC_PASSWORD=sonar \ | ||
SONARQUBE_JDBC_URL= | ||
|
||
ENV SONARQUBE_PLUGIN_DIR=$SONARQUBE_HOME/extensions/plugins | ||
MAINTAINER Alejandro Sanchez ([email protected]) | ||
|
||
ENV SUMMARY="SonarQube for bcgov OpenShift" \ | ||
DESCRIPTION="This image creates the SonarQube image for use at bcgov/OpenShift" | ||
DESCRIPTION="This image creates the SonarQube image for use at bcgov/OpenShift" | ||
|
||
LABEL summary="$SUMMARY" \ | ||
description="$DESCRIPTION" \ | ||
|
@@ -28,32 +18,30 @@ LABEL summary="$SUMMARY" \ | |
io.openshift.tags="sonarqube" \ | ||
release="$SONAR_VERSION" | ||
|
||
USER root | ||
EXPOSE 9000 | ||
ADD root / | ||
# Define Plug-in Versions | ||
ARG SONAR_ZAP_PLUGIN_VERSION=1.2.0 | ||
ENV SONARQUBE_PLUGIN_DIR="$SONARQUBE_HOME/extensions/plugins" | ||
|
||
RUN set -x \ | ||
&& cd /opt \ | ||
&& curl -o sonarqube.zip -fSL https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-$SONAR_VERSION.zip \ | ||
&& unzip sonarqube.zip \ | ||
&& mv sonarqube-$SONAR_VERSION sonarqube \ | ||
&& rm sonarqube.zip* \ | ||
&& rm -rf $SONARQUBE_HOME/bin/* | ||
# Switch to root for package installs | ||
USER 0 | ||
|
||
# ================================================================================================================================================================================ | ||
# Bundle Plug-in(s) | ||
# -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
|
||
# sonar-zap-plugin | ||
# https://github.com/Coveros/zap-sonar-plugin | ||
ADD https://github.com/Coveros/zap-sonar-plugin/releases/download/sonar-zap-plugin-$SONAR_ZAP_PLUGIN_VERSION/sonar-zap-plugin-$SONAR_ZAP_PLUGIN_VERSION.jar $SONARQUBE_PLUGIN_DIR | ||
# sonar-zap-plugin - https://github.com/Coveros/zap-sonar-plugin | ||
RUN set -x \ | ||
&& cd "$SONARQUBE_PLUGIN_DIR" \ | ||
&& curl -o "sonar-zap-plugin-$SONAR_ZAP_PLUGIN_VERSION.jar" -fsSL "https://github.com/Coveros/zap-sonar-plugin/releases/download/sonar-zap-plugin-$SONAR_ZAP_PLUGIN_VERSION/sonar-zap-plugin-$SONAR_ZAP_PLUGIN_VERSION.jar" | ||
|
||
WORKDIR $SONARQUBE_HOME | ||
COPY run.sh $SONARQUBE_HOME/bin/ | ||
|
||
RUN useradd -r sonar | ||
RUN /usr/bin/fix-permissions $SONARQUBE_HOME \ | ||
&& chmod 775 $SONARQUBE_HOME/bin/run.sh | ||
# In order to drop the root user, we have to make some directories world | ||
# writable as OpenShift default security model is to run the container under | ||
# random UIDs. | ||
RUN chown -R 1001:0 "$SONARQUBE_HOME" \ | ||
&& chgrp -R 0 "$SONARQUBE_HOME" \ | ||
&& chmod -R g+rwX "$SONARQUBE_HOME" \ | ||
&& chmod 775 "$SONARQUBE_HOME/bin/run.sh" | ||
|
||
USER sonar | ||
ENTRYPOINT ["./bin/run.sh"] | ||
USER 1001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters