forked from techdivision/docker-sonar-scanner
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
29 lines (22 loc) · 952 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM java:8-alpine
ENV SONAR_SCANNER_VERSION=2.8 \
SONAR_SCANNER_HOME=/opt/sonar-scanner \
SONAR_SCANNER_OPTS="-Xmx512m"
RUN set -x \
# Install build depency
&& apk add --no-cache curl \
# Fetch and install sonar scanner
&& curl -fsSLO https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-${SONAR_SCANNER_VERSION}.zip \
&& unzip sonar-scanner-${SONAR_SCANNER_VERSION}.zip \
&& mkdir /opt \
&& mv sonar-scanner-$SONAR_SCANNER_VERSION $SONAR_SCANNER_HOME \
# Remove zip files
&& rm sonar-scanner-${SONAR_SCANNER_VERSION}.zip \
# Remove files for windows
&& rm -rf $SONAR_SCANNER_HOME/bin/*.bat \
# Create symlinks
&& ln -s $SONAR_SCANNER_HOME/bin/sonar-runner /usr/bin/sonar-runner\
&& ln -s $SONAR_SCANNER_HOME/bin/sonar-scanner /usr/bin/sonar-scanner \
&& ln -s $SONAR_SCANNER_HOME/bin/sonar-scanner-debug /usr/bin/sonar-scanner-debug \
# Remove build dependency
&& apk del curl