From 305104020f8319ef897c3547655aa7c895e2b1bd Mon Sep 17 00:00:00 2001 From: Thomas Ardal Date: Fri, 15 Nov 2024 13:45:57 +0100 Subject: [PATCH] Install .NET 9 --- Dockerfile | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index c08ec9c..6ecd93c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,24 @@ -# Container image that runs your code -FROM alpine:3.18 - -# Install necessary dependencies -RUN apk update && \ - apk add --no-cache wget bash ca-certificates-bundle libgcc libssl3 libstdc++ zlib icu-libs && \ - rm -rf /var/cache/apk/* - -# Download and install .NET Core SDK -RUN wget -q https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \ - chmod +x dotnet-install.sh && \ - ./dotnet-install.sh --version latest --install-dir /usr/share/dotnet && \ - rm dotnet-install.sh - -# Add .NET to the PATH environment variable -ENV PATH="$PATH:/usr/share/dotnet" - -# Copies your code file from your action repository to the filesystem path `/` of the container -COPY entrypoint.sh /entrypoint.sh - -RUN chmod +x /entrypoint.sh - -# Code file to execute when the docker container starts up (`entrypoint.sh`) +# Container image that runs your code +FROM alpine:3.18 + +# Install necessary dependencies +RUN apk update && \ + apk add --no-cache wget bash ca-certificates-bundle libgcc libssl3 libstdc++ zlib icu-libs && \ + rm -rf /var/cache/apk/* + +# Download and install .NET Core SDK +RUN wget -q https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \ + chmod +x dotnet-install.sh && \ + ./dotnet-install.sh --channel 9.0 --install-dir /usr/share/dotnet && \ + rm dotnet-install.sh + +# Add .NET to the PATH environment variable +ENV PATH="$PATH:/usr/share/dotnet" + +# Copies your code file from your action repository to the filesystem path `/` of the container +COPY entrypoint.sh /entrypoint.sh + +RUN chmod +x /entrypoint.sh + +# Code file to execute when the docker container starts up (`entrypoint.sh`) ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file