-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Dockerfile
28 lines (21 loc) · 1005 Bytes
/
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
ARG REPO=mcr.microsoft.com/dotnet/runtime
# Installer image
FROM mcr.microsoft.com/azurelinux/base/core:3.0 AS installer
RUN tdnf install -y \
ca-certificates \
gzip \
tar \
&& tdnf clean all
# Retrieve ASP.NET Core
RUN aspnetcore_version=9.0.0 \
&& curl -fSL --output aspnetcore.tar.gz https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/$aspnetcore_version/aspnetcore-runtime-$aspnetcore_version-linux-x64.tar.gz \
&& aspnetcore_sha512='1a81023f119dd5e5b0f9d87b0e3c42df89824b9fcb73192a4670cc2c67358cd018a7c9c965245c7883de468bda88c81d64a21c60f9bc68a6559d76f32d34ce96' \
&& echo "$aspnetcore_sha512 aspnetcore.tar.gz" | sha512sum -c - \
&& mkdir -p /dotnet \
&& tar -oxzf aspnetcore.tar.gz -C /dotnet ./shared/Microsoft.AspNetCore.App \
&& rm aspnetcore.tar.gz
# ASP.NET Core image
FROM $REPO:9.0.0-azurelinux3.0-distroless-extra-amd64
# ASP.NET Core version
ENV ASPNET_VERSION=9.0.0
COPY --from=installer ["/dotnet", "/usr/share/dotnet"]