-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile_net601_sdk
86 lines (77 loc) · 4.27 KB
/
Dockerfile_net601_sdk
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
ARG REPO=mcr.microsoft.com/dotnet/aspnet
FROM $REPO:6.0.1-alpine3.14-amd64
ENV \
# Unset ASPNETCORE_URLS from aspnet base image
ASPNETCORE_URLS= \
# Do not generate certificate
DOTNET_GENERATE_ASPNET_CERTIFICATE=false \
# Do not show first run text
DOTNET_NOLOGO=true \
# SDK version
DOTNET_SDK_VERSION=6.0.101 \
# Disable the invariant mode (set in base image)
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# Unset Logging__Console__FormatterName from aspnet base image
Logging__Console__FormatterName= \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
# PowerShell telemetry for docker image usage
POWERSHELL_DISTRIBUTION_CHANNEL=PSDocker-DotnetSDK-Alpine-3.14 \
# perf tool required. .NET 6 standardizes on the prefix DOTNET_ instead of COMPlus_ for environment variables that configure .NET run-time behavior.
COMPlus_PerfMapEnabled=1 \
COMPlus_EnableEventLog=1 \
DOTNET_PerfMapEnabled=1 \
DOTNET_EnableEventLog=1 \
COMPlus_DbgEnableMiniDump=1 \
COMPlus_DbgMiniDumpType=4 \
COMPlus_DbgMiniDumpName=/app/site/coredump.dmp
RUN apk add --no-cache \
curl \
icu-libs \
git
# Install .NET SDK
RUN wget -O dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-musl-x64.tar.gz \
&& dotnet_sha512='113428f918514d9be657e18ec454281d1f86b7e6a3214b4327379b4ab679dc60569149e943e894a169c0523f9513f3aed02ddc252daef66b67e514d3501f17a5' \
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
&& mkdir -p /usr/share/dotnet \
&& tar -C /usr/share/dotnet -oxzf dotnet.tar.gz ./packs ./sdk ./sdk-manifests ./templates ./LICENSE.txt ./ThirdPartyNotices.txt \
&& rm dotnet.tar.gz \
# Trigger first run experience by running arbitrary cmd
&& dotnet help
# Install PowerShell global tool
RUN powershell_version=7.2.1 \
&& wget -O PowerShell.Linux.Alpine.$powershell_version.nupkg https://pwshtool.blob.core.windows.net/tool/$powershell_version/PowerShell.Linux.Alpine.$powershell_version.nupkg \
&& powershell_sha512='04cc80e327b12ef896c171be311c770e712c7987b6cdb93c21842367c14f6444c5260e65159adb3100a2346cb69971afb30a00f2b9adc93bd92d23e0bcaae8dc' \
&& echo "$powershell_sha512 PowerShell.Linux.Alpine.$powershell_version.nupkg" | sha512sum -c - \
&& mkdir -p /usr/share/powershell \
&& dotnet tool install --add-source / --tool-path /usr/share/powershell --version $powershell_version PowerShell.Linux.Alpine \
&& dotnet nuget locals all --clear \
&& rm PowerShell.Linux.Alpine.$powershell_version.nupkg \
&& chmod 755 /usr/share/powershell/pwsh \
&& ln -s /usr/share/powershell/pwsh /usr/bin/pwsh \
# To reduce image size, remove the copy nupkg that nuget keeps.
&& find /usr/share/powershell -print | grep -i '.*[.]nupkg$' | xargs rm \
# Add ncurses-terminfo-base to resolve psreadline dependency
&& apk add --no-cache ncurses-terminfo-base
RUN dotnet tool install -g dotnet-sos
RUN apk add lldb
RUN dotnet tool install -g dotnet-trace
RUN dotnet tool install -g dotnet-counters
RUN dotnet tool install -g dotnet-dump
RUN dotnet tool install -g dotnet-symbol
RUN apk update \
&& apk add unixodbc \
&& apk add unixodbc-dev
RUN wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.6.1.1-1_amd64.apk \
&& wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_17.6.1.1-1_amd64.apk \
&& apk add gnupg \
&& wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.6.1.1-1_amd64.sig \
&& wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_17.6.1.1-1_amd64.sig \
&& apk add --allow-untrusted msodbcsql17_17.6.1.1-1_amd64.apk \
&& apk add --allow-untrusted mssql-tools_17.6.1.1-1_amd64.apk
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
RUN apk add --no-cache icu-libs
RUN apk add --no-cache \
perf