Created
October 17, 2020 14:54
-
-
Save fRanK45jPm/948bcb0c0305af1142c8848648893cc1 to your computer and use it in GitHub Desktop.
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
FROM openjdk:11-jre-slim | |
RUN apt-get update \ | |
&& apt-get install -y curl gnupg2 unzip \ | |
&& rm -rf /var/lib/apt/lists/* | |
ENV SONAR_VERSION=7.9.4 \ | |
SONARQUBE_HOME=/opt/sonarqube \ | |
SONARQUBE_JDBC_USERNAME=sonar \ | |
SONARQUBE_JDBC_PASSWORD=sonar \ | |
SONARQUBE_JDBC_URL="" | |
# Http port | |
EXPOSE 9000 | |
RUN groupadd -r sonarqube && useradd -r -g sonarqube sonarqube | |
# pub 2048R/D26468DE 2015-05-25 | |
# Key fingerprint = F118 2E81 C792 9289 21DB CAB4 CFCA 4A29 D264 68DE | |
# uid sonarsource_deployer (Sonarsource Deployer) <infra@sonarsource.com> | |
# sub 2048R/06855C1D 2015-05-25 | |
RUN for server in $(shuf -e ha.pool.sks-keyservers.net \ | |
hkp://p80.pool.sks-keyservers.net:80 \ | |
keyserver.ubuntu.com \ | |
hkp://keyserver.ubuntu.com:80 \ | |
pgp.mit.edu) ; do \ | |
gpg --batch --keyserver "$server" --recv-keys F1182E81C792928921DBCAB4CFCA4A29D26468DE && break || : ; \ | |
done | |
RUN set -x \ | |
&& cd /opt \ | |
&& curl -o sonarqube.zip -fSL https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-$SONAR_VERSION.zip \ | |
&& curl -o sonarqube.zip.asc -fSL https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-$SONAR_VERSION.zip.asc \ | |
&& gpg --batch --verify sonarqube.zip.asc sonarqube.zip \ | |
&& unzip -q sonarqube.zip \ | |
&& mv sonarqube-$SONAR_VERSION sonarqube \ | |
&& chown -R sonarqube:sonarqube sonarqube \ | |
&& rm sonarqube.zip* \ | |
&& rm -rf $SONARQUBE_HOME/bin/* | |
VOLUME "$SONARQUBE_HOME/data" | |
WORKDIR $SONARQUBE_HOME | |
COPY run.sh $SONARQUBE_HOME/bin/ | |
USER sonarqube | |
ENTRYPOINT ["./bin/run.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment