Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit dd56da7

Browse files
committed
Add sonarqube:7.3-alpine image.
1 parent c4a553a commit dd56da7

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

sonarqube-7.3-alpine/Dockerfile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
FROM openjdk:8-alpine
2+
3+
ENV SONAR_VERSION=7.3 \
4+
SONARQUBE_HOME=/opt/sonarqube \
5+
# Database configuration
6+
# Defaults to using H2
7+
SONARQUBE_JDBC_USERNAME=sonar \
8+
SONARQUBE_JDBC_PASSWORD=sonar \
9+
SONARQUBE_JDBC_URL=
10+
11+
# Http port
12+
EXPOSE 9000
13+
14+
RUN addgroup -S sonarqube && adduser -S -G sonarqube sonarqube
15+
16+
RUN set -x \
17+
&& apk add --no-cache gnupg unzip \
18+
&& apk add --no-cache libressl wget \
19+
&& apk add --no-cache su-exec \
20+
&& apk add --no-cache bash \
21+
22+
# pub 2048R/D26468DE 2015-05-25
23+
# Key fingerprint = F118 2E81 C792 9289 21DB CAB4 CFCA 4A29 D264 68DE
24+
# uid sonarsource_deployer (Sonarsource Deployer) <[email protected]>
25+
# sub 2048R/06855C1D 2015-05-25
26+
&& (gpg --keyserver ha.pool.sks-keyservers.net --recv-keys F1182E81C792928921DBCAB4CFCA4A29D26468DE \
27+
|| gpg --keyserver ipv4.pool.sks-keyservers.net --recv-keys F1182E81C792928921DBCAB4CFCA4A29D26468DE) \
28+
29+
&& mkdir /opt \
30+
&& cd /opt \
31+
&& wget -O sonarqube.zip --no-verbose https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-$SONAR_VERSION.zip \
32+
&& wget -O sonarqube.zip.asc --no-verbose https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-$SONAR_VERSION.zip.asc \
33+
&& gpg --batch --verify sonarqube.zip.asc sonarqube.zip \
34+
&& unzip sonarqube.zip \
35+
&& mv sonarqube-$SONAR_VERSION sonarqube \
36+
&& chown -R sonarqube:sonarqube sonarqube \
37+
&& rm sonarqube.zip* \
38+
&& rm -rf $SONARQUBE_HOME/bin/*
39+
40+
VOLUME "$SONARQUBE_HOME/data"
41+
42+
WORKDIR $SONARQUBE_HOME
43+
COPY run.sh $SONARQUBE_HOME/bin/
44+
ENTRYPOINT ["./bin/run.sh"]

sonarqube-7.3-alpine/run.sh

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

0 commit comments

Comments
 (0)