-
Notifications
You must be signed in to change notification settings - Fork 30
/
Dockerfile
53 lines (46 loc) · 2.21 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
FROM openjdk:8u171-jre-stretch
LABEL maintainer="Burak Ince <[email protected]>"
ENV SONAR_SCANNER_MSBUILD_VERSION=4.3.1.1372 \
SONAR_SCANNER_VERSION=3.2.0.1227 \
DOTNET_SDK_VERSION=2.1 \
MONO_DEBIAN_VERSION=5.12.0.226-0xamarin3+debian9b1 \
SONAR_SCANNER_MSBUILD_HOME=/opt/sonar-scanner-msbuild \
DOTNET_PROJECT_DIR=/project \
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true \
DOTNET_CLI_TELEMETRY_OPTOUT=true
RUN set -x \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& echo "deb http://download.mono-project.com/repo/debian stable-stretch main" | tee /etc/apt/sources.list.d/mono-official-stable.list \
&& apt-get update \
&& apt-get install \
curl \
libunwind8 \
gettext \
apt-transport-https \
mono-complete="$MONO_DEBIAN_VERSION" \
ca-certificates-mono="$MONO_DEBIAN_VERSION" \
referenceassemblies-pcl \
mono-xsp4 \
wget \
unzip \
-y \
&& curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg \
&& mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg \
&& sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/debian/9/prod stretch main" > /etc/apt/sources.list.d/microsoft-prod.list' \
&& apt-get update \
&& apt-get install dotnet-sdk-$DOTNET_SDK_VERSION -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/$SONAR_SCANNER_MSBUILD_VERSION/sonar-scanner-msbuild-$SONAR_SCANNER_MSBUILD_VERSION-net46.zip -O /opt/sonar-scanner-msbuild.zip \
&& mkdir -p $SONAR_SCANNER_MSBUILD_HOME \
&& mkdir -p $DOTNET_PROJECT_DIR \
&& unzip /opt/sonar-scanner-msbuild.zip -d $SONAR_SCANNER_MSBUILD_HOME \
&& rm /opt/sonar-scanner-msbuild.zip \
&& chmod 775 $SONAR_SCANNER_MSBUILD_HOME/*.exe \
&& chmod 775 $SONAR_SCANNER_MSBUILD_HOME/**/bin/* \
&& chmod 775 $SONAR_SCANNER_MSBUILD_HOME/**/lib/*.jar
ENV PATH="$SONAR_SCANNER_MSBUILD_HOME:$SONAR_SCANNER_MSBUILD_HOME/sonar-scanner-$SONAR_SCANNER_VERSION/bin:${PATH}"
COPY run.sh $SONAR_SCANNER_MSBUILD_HOME/sonar-scanner-$SONAR_SCANNER_VERSION/bin/
VOLUME $DOTNET_PROJECT_DIR
WORKDIR $DOTNET_PROJECT_DIR
ENTRYPOINT ["run.sh"]