-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathDockerfile
67 lines (57 loc) · 2.48 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
61
62
63
64
65
66
67
FROM mcr.microsoft.com/dotnet/sdk:6.0.412
# Dockerfile meta-information
LABEL maintainer="NOS Inovação S.A." \
app_name="dotnet-sonar"
ENV SONAR_SCANNER_MSBUILD_VERSION=5.13.0.66756 \
DOTNETCORE_SDK=6.0.412 \
DOTNETCORE_RUNTIME=6.0.20 \
NETAPP_VERSION=net5.0 \
DOCKER_VERSION=5:20.10.21~3-0~debian-bullseye \
CONTAINERD_VERSION=1.6.10-1 \
OPENJDK_VERSION=17 \
NODEJS_VERSION=16
# Linux update
RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get install -y \
apt-transport-https \
ca-certificates-java \
ca-certificates \
curl \
gnupg-agent \
lsb-release \
software-properties-common
RUN mkdir -p /usr/share/man/man1mkdir -p /usr/share/man/man1
# Install Java
RUN apt-get install -y openjdk-$OPENJDK_VERSION-jre
# Install NodeJs
RUN wget https://deb.nodesource.com/setup_$NODEJS_VERSION.x \
&& bash setup_$NODEJS_VERSION.x \
&& apt-get install -y nodejs
# Install all necessary additional software
RUN mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
&& echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update \
&& apt-get install -y \
docker-ce=$DOCKER_VERSION \
docker-ce-cli=$DOCKER_VERSION \
containerd.io=$CONTAINERD_VERSION
# Need to install DotNet5 SDK - Only needed until there's no sonar-scanner with dotNet6 support
# RUN wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
# && dpkg -i packages-microsoft-prod.deb \
# && rm packages-microsoft-prod.deb \
# && apt-get update \
# && apt-get install -y dotnet-sdk-5.0
# Install Sonar Scanner
RUN apt-get install -y unzip \
&& wget https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/$SONAR_SCANNER_MSBUILD_VERSION/sonar-scanner-msbuild-$SONAR_SCANNER_MSBUILD_VERSION-$NETAPP_VERSION.zip \
&& unzip sonar-scanner-msbuild-$SONAR_SCANNER_MSBUILD_VERSION-$NETAPP_VERSION.zip -d /sonar-scanner \
&& rm sonar-scanner-msbuild-$SONAR_SCANNER_MSBUILD_VERSION-$NETAPP_VERSION.zip \
&& chmod +x -R /sonar-scanner
# Cleanup
RUN apt-get -q autoremove \
&& apt-get -q clean -y \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*.bin