Skip to content

Instantly share code, notes, and snippets.

@ptupitsyn
Created June 15, 2023 06:15
Show Gist options
  • Save ptupitsyn/d9d7930c4f0d1840919ced5367bffc5e to your computer and use it in GitHub Desktop.
Save ptupitsyn/d9d7930c4f0d1840919ced5367bffc5e to your computer and use it in GitHub Desktop.
.NET 8 ARM Docker build
#!/bin/sh
docker buildx build --platform linux/amd64,linux/arm64 .
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"]
<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>
// 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