Skip to content

Commit

Permalink
Update to .NET SDK 8 to create multi-arch Docker image.
Browse files Browse the repository at this point in the history
  • Loading branch information
aholmes committed Nov 17, 2023
1 parent 7bffeac commit 5d54699
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
ARG BUILDPLATFORM
ARG TARGETARCH
WORKDIR /app

COPY . ./
RUN dotnet restore
RUN dotnet restore -a $TARGETARCH

RUN dotnet publish --no-restore -c Release -o out
RUN dotnet publish -a $TARGETARCH --no-restore -c Release -o out

FROM mcr.microsoft.com/dotnet/aspnet:6.0
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build-env /app/out .

Expand Down
2 changes: 1 addition & 1 deletion hubitat2prom.Tests/hubitat2prom.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion hubitat2prom/hubitat2prom.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 5d54699

Please sign in to comment.