Created
July 4, 2021 07:52
-
-
Save kant2002/0884c457943c9b6126bdfee091167024 to your computer and use it in GitHub Desktop.
NativeAOTDocker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS build | |
WORKDIR /app | |
COPY HelloWorldStatic.csproj . | |
COPY nuget.config . | |
RUN dotnet restore --runtime linux-musl-x64 HelloWorldStatic.csproj | |
RUN apk add clang libexecinfo binutils musl-dev build-base zlib-static | |
COPY . . | |
RUN dotnet publish -c Release -r linux-musl-x64 -o out HelloWorldStatic.csproj | |
FROM scratch AS runtime | |
WORKDIR /app | |
COPY --from=build /app/out/* /app/ | |
ENTRYPOINT ["/app/HelloWorldStatic"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<PropertyGroup> | |
<StaticallyLinked>true</StaticallyLinked> | |
<InvariantGlobalization>true</InvariantGlobalization> | |
<IlcDisableReflection>true</IlcDisableReflection> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="6.0.0-*" /> | |
</ItemGroup> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment