Created
June 15, 2023 06:15
-
-
Save ptupitsyn/d9d7930c4f0d1840919ced5367bffc5e to your computer and use it in GitHub Desktop.
.NET 8 ARM Docker build
This file contains 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
#!/bin/sh | |
docker buildx build --platform linux/amd64,linux/arm64 . |
This file contains 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/runtime:8.0-preview AS base | |
WORKDIR /app | |
FROM mcr.microsoft.com/dotnet/sdk:8.0-preview AS build | |
WORKDIR /src | |
COPY dotnet-arm.csproj . | |
RUN dotnet restore | |
COPY . . | |
RUN dotnet build -c Release -o /app/build | |
FROM build AS publish | |
RUN dotnet publish -c Release -o /app/publish | |
FROM base AS final | |
WORKDIR /app | |
COPY --from=publish /app/publish . | |
ENTRYPOINT ["dotnet", "dotnet-arm.dll"] |
This file contains 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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net8.0</TargetFramework> | |
<RootNamespace>dotnet_arm</RootNamespace> | |
<ImplicitUsings>enable</ImplicitUsings> | |
<Nullable>enable</Nullable> | |
</PropertyGroup> | |
</Project> |
This file contains 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
// See https://aka.ms/new-console-template for more information | |
Console.WriteLine("Hello, World!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment