-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathDockerfile
63 lines (59 loc) · 4 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
ARG REPO=mcr.microsoft.com/dotnet/aspnet
FROM $REPO:6.0.36-cbl-mariner2.0-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.428 \
# Enable correct mode for dotnet watch (only mode supported in a container)
DOTNET_USE_POLLING_FILE_WATCHER=true \
# 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-CBL-Mariner-2.0
RUN tdnf install -y \
git \
tar \
&& tdnf clean all
# Install .NET SDK
RUN curl -fSL --output dotnet.rpm https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-x64.rpm \
&& dotnet_sha512='80dc18404bff94b9407894e3a65029eefe70e2ff2f22cb929b589d9bd011b4a7450ffa8feaf8c560f3c767e4a2a30d6fe912945ec6988dc0e6f48ad60f41449b' \
&& echo "$dotnet_sha512 dotnet.rpm" | sha512sum -c - \
\
&& curl -fSL --output apphost.rpm https://dotnetcli.azureedge.net/dotnet/Runtime/$DOTNET_VERSION/dotnet-apphost-pack-$DOTNET_VERSION-x64.rpm \
&& dotnet_sha512='7df4888e586c82c2fcf404850de6d74849d7c733483f317cd108231946d95fe19ea50239a37222d2470e1ba4d943de1e9754409b8cf0e1fab13f0509c2c8d378' \
&& echo "$dotnet_sha512 apphost.rpm" | sha512sum -c - \
\
&& curl -fSL --output targeting-pack.rpm https://dotnetcli.azureedge.net/dotnet/Runtime/6.0.36/dotnet-targeting-pack-6.0.36-x64.rpm \
&& dotnet_sha512='985c5cda972f50b4d518875641da030811980f930f98cdf46461f8c8089dd23191eaad6715d299ccddc49bd260c67ff4b59b3780a37fbd8a7aa7214af04155f4' \
&& echo "$dotnet_sha512 targeting-pack.rpm" | sha512sum -c - \
\
&& curl -fSL --output aspnetcore-targeting-pack.rpm https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/6.0.36/aspnetcore-targeting-pack-6.0.36-x64.rpm \
&& dotnet_sha512='7bd9d2add955f467e5cc79805f827ea6edd94c9b6312ba8c749c60b04d845bc89f4a1b0b7ac13c873a36ac56317504796e754a47d4a8431f552270ea6b475f00' \
&& echo "$dotnet_sha512 aspnetcore-targeting-pack.rpm" | sha512sum -c - \
\
&& curl -fSL --output netstandard-targeting-pack.rpm https://dotnetcli.azureedge.net/dotnet/Runtime/3.1.0/netstandard-targeting-pack-2.1.0-x64.rpm \
&& dotnet_sha512='fab41a86b9182b276992795247868c093890c6b3d5739376374a302430229624944998e054de0ff99bddd9459fc9543636df1ebd5392db069ae953ac17ea2880' \
&& echo "$dotnet_sha512 netstandard-targeting-pack.rpm" | sha512sum -c - \
\
&& tdnf install -y --disablerepo=* dotnet.rpm apphost.rpm targeting-pack.rpm aspnetcore-targeting-pack.rpm netstandard-targeting-pack.rpm \
&& rm dotnet.rpm apphost.rpm targeting-pack.rpm aspnetcore-targeting-pack.rpm netstandard-targeting-pack.rpm \
# Trigger first run experience by running arbitrary cmd
&& dotnet help
# Install PowerShell global tool
RUN powershell_version=7.2.23 \
&& curl -fSL --output PowerShell.Linux.x64.$powershell_version.nupkg https://powershellinfraartifacts-gkhedzdeaghdezhr.z01.azurefd.net/tool/$powershell_version/PowerShell.Linux.x64.$powershell_version.nupkg \
&& powershell_sha512='9e3bfcf3684541e96f4a535f1053f8f2669f85dcebdd6849e8b548b069d65c4461cfe8f191c0ac17369e87414754788ecf447c18d54ba257d13ca1c4b0395d29' \
&& echo "$powershell_sha512 PowerShell.Linux.x64.$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.x64 \
&& dotnet nuget locals all --clear \
&& rm PowerShell.Linux.x64.$powershell_version.nupkg \
&& ln -s /usr/share/powershell/pwsh /usr/bin/pwsh \
&& chmod 755 /usr/share/powershell/pwsh \
# To reduce image size, remove the copy nupkg that nuget keeps.
&& find /usr/share/powershell -print | grep -i '.*[.]nupkg$' | xargs rm