-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dotnet-5.0
48 lines (38 loc) · 1.73 KB
/
Dockerfile.dotnet-5.0
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
ARG BASE_IMAGE_NAME="sentoz/multi-sonarqube-scanner-cli"
ARG BASE_IMAGE_TAG="latest-base-focal"
FROM $BASE_IMAGE_NAME:$BASE_IMAGE_TAG
LABEL org.opencontainers.image.authors="Dmitriy Okladin <[email protected]>"
LABEL org.opencontainers.image.source="https://github.com/sentoz/multi-sonarqube-scanner-cli"
ARG SONARQUBE_TOKEN
ARG SONARQUBE_URL
ARG SONAR_SCANNER_HOME=/opt/sonar-scanner
ARG DOTNET_SONARSCANNER_VERSION=6.0
ENV HOME=/tmp
ENV XDG_CONFIG_HOME=/tmp
ENV SONAR_SCANNER_HOME=$SONAR_SCANNER_HOME
ENV SONAR_USER_HOME=$SONAR_SCANNER_HOME/.sonar
ENV PATH=$SONAR_SCANNER_HOME/bin:$PATH
ENV NODE_PATH=/usr/lib/node_modules
ENV SRC_PATH=/usr/src
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV JAVA_OPTS="-Danalyzer.bundle.audit.path=/usr/bin/bundle-audit -Danalyzer.golang.path=/usr/local/go/bin/go"
WORKDIR /opt
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,DL3013,DL3016,DL3028,SC2015,SC1001
RUN set -eux; \
wget -U "scannercli" -q -O "/opt/packages-microsoft-prod.deb" \
"https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb"; \
dpkg -i "/opt/packages-microsoft-prod.deb" ;\
rm "/opt/packages-microsoft-prod.deb"; \
apt-get --fix-broken -y --no-install-recommends install; \
apt-get update && apt-get upgrade -y; \
apt-get install -yq --no-install-recommends dotnet-sdk-5.0 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* ;\
dotnet tool install dotnet-sonarscanner --version "$DOTNET_SONARSCANNER_VERSION" \
--tool-path /usr/bin/ --ignore-failed-sources; \
dotnet tool install dotnet-reportgenerator-globaltool --version 5.1.26 \
--tool-path /usr/bin/ --ignore-failed-sources;
WORKDIR $SRC_PATH
ENTRYPOINT ["/usr/bin/docker_entrypoint"]