-
Notifications
You must be signed in to change notification settings - Fork 2k
/
Copy pathDockerfile
60 lines (51 loc) · 2.74 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
ARG REPO=mcr.microsoft.com/dotnet/aspnet
# Installer image
FROM $REPO:10.0.0-preview.2-azurelinux3.0-arm64v8 AS installer
RUN tdnf install -y \
tar \
&& tdnf clean all
# Install .NET SDK
RUN curl -fSL --output dotnet.tar.gz https://ci.dot.net/public/Sdk/10.0.100-preview.2.25164.34/dotnet-sdk-10.0.100-preview.2.25164.34-linux-arm64.tar.gz \
&& dotnet_sha512='0491381366f50d6a2211f925f5c5b2e1364f3b3a45076c706dacd3afa6856dd95efb6bacccc8874718bde37439e77614ff2bfd580c3c2e97737d42db311db5e6' \
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
&& mkdir -p /dotnet \
&& tar -oxzf dotnet.tar.gz -C /dotnet ./packs ./sdk ./sdk-manifests ./templates ./LICENSE.txt ./ThirdPartyNotices.txt \
&& rm dotnet.tar.gz
# .NET SDK image
FROM $REPO:10.0.0-preview.2-azurelinux3.0-arm64v8
ENV \
# Do not generate certificate
DOTNET_GENERATE_ASPNET_CERTIFICATE=false \
# Do not show first run text
DOTNET_NOLOGO=true \
# SDK version
DOTNET_SDK_VERSION=10.0.100-preview.2.25164.34 \
# 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-Azure-Linux-3.0-arm64 \
# Workaround for https://github.com/PowerShell/PowerShell/issues/20685
DOTNET_ROLL_FORWARD=Major
RUN tdnf install -y \
git \
libgcc-atomic \
tar \
&& tdnf clean all
COPY --from=installer ["/dotnet", "/usr/share/dotnet"]
# Trigger first run experience by running arbitrary cmd
RUN dotnet help
# Install PowerShell global tool
RUN powershell_version=7.5.0 \
&& curl -fSL --output PowerShell.Linux.arm64.$powershell_version.nupkg https://powershellinfraartifacts-gkhedzdeaghdezhr.z01.azurefd.net/tool/$powershell_version/PowerShell.Linux.arm64.$powershell_version.nupkg \
&& powershell_sha512='42501dd83f75a5e6d73d41d52c010a243e3397034b6cb82385310783fe3173ae5d3ade8e80247055b8f8f4d986be8dd86c0176081fbe45faa02c3f78f6fdc78f' \
&& echo "$powershell_sha512 PowerShell.Linux.arm64.$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.arm64 \
&& dotnet nuget locals all --clear \
&& rm PowerShell.Linux.arm64.$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