This commit is contained in:
Felix Weiß
2024-01-01 18:20:56 +01:00
parent 5e247498ce
commit 0a0a1e1909
3 changed files with 23 additions and 1 deletions

View File

@@ -39,7 +39,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: ${{ github.workspace }}/src
file: ${{ github.workspace }}/src/DynDNSv2/Dockerfile
file: ${{ github.workspace }}/src/DynDNSv2/MultiBuild.Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}

View File

@@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<!--<ContainerFamily>alpine</ContainerFamily>-->
<UserSecretsId>abe55787-bc11-416d-85aa-eaf544f21fe1</UserSecretsId>
</PropertyGroup>

View File

@@ -0,0 +1,21 @@
# Learn about building .NET container images:
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
ARG TARGETARCH
WORKDIR /source
# copy csproj and restore as distinct layers
COPY ./DynDNSv2/DynDNSv2.csproj .
RUN dotnet restore -a $TARGETARCH
# copy and publish app and libraries
COPY ./DynDNSv2/. .
RUN dotnet publish --no-restore -a $TARGETARCH -o /app
# Enable globalization and time zones:
# https://github.com/dotnet/dotnet-docker/blob/main/samples/enable-globalization.md
# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["./DynDNSv2"]