This repository has been archived by the owner on Dec 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
61 lines (46 loc) · 2.1 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM philipssoftware/node:16-java
LABEL maintainer="Jeroen Knoops <[email protected]>"
ENV SONAR_SCANNER_VERSION 4.7.0.2747-linux
USER root
RUN apt-get update && \
apt-get install -y \
python3-pip \
python-pip \
ca-certificates \
grep \
sed \
shellcheck \
unzip && \
rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip
RUN pip install -U setuptools
RUN pip install -U pylint
RUN npm install -g typescript@">=3.2.1 <3.8.0"
WORKDIR /root
RUN curl -o ./sonarscanner.zip -L https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION.zip
RUN unzip sonarscanner.zip
RUN rm sonarscanner.zip
ENV SONAR_RUNNER_HOME=/root/sonar-scanner-$SONAR_SCANNER_VERSION
ENV PATH $PATH:/root/sonar-scanner-$SONAR_SCANNER_VERSION/bin
ENV NODE_PATH=/usr/local/lib/node_modules
# The config should be set in the project. See sonar-project.properties as example.
# COPY sonar-project.properties ./sonar-scanner-$SONAR_SCANNER_VERSION/conf/sonar-scanner.properties
# ensure Sonar uses the provided Java for musl instead of a borked glibc one
RUN sed -i 's/use_embedded_jre=true/use_embedded_jre=false/g' /root/sonar-scanner-$SONAR_SCANNER_VERSION/bin/sonar-scanner
ADD REPO TAGS /root/
RUN echo "\
----------------------------------------------------------------------------------------------\n\
TAGS: $(cat /TAGS)\n\
REPO: $(cat /REPO)\n\
----------------------------------------------------------------------------------------------\n\
SONARSCANNER: $(sonar-scanner --version)\n\
----------------------------------------------------------------------------------------------\n\
PYTHON: $(python --version 2>&1)\n\
PYTHON3: $(python3 --version)\n\
NODE: $(node --version)\n\
JAVA: $(java -version 2>&1 | head -n 1 | awk -F '"' '{print $2}')\n\
----------------------------------------------------------------------------------------------"\
> /etc/motd
# Use bash if you want to run the environment from inside the shell, otherwise use the command that actually runs the underlying stuff
#CMD /bin/bash
CMD sonar-scanner -Dsonar.projectBaseDir=./src