From 5eafecf30f7509b6e65a3cde297c404bfd018251 Mon Sep 17 00:00:00 2001 From: Mia Winter Date: Fri, 17 Nov 2023 23:23:44 +0100 Subject: [PATCH] added: docker multi-platform support (buildx) --- CHANGELOG.md | 4 +++- Dockerfile | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5af8795..866a29c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,14 @@ # Changelog -## [Unreleased] +## [1.2.0] - 2023-11-17 ### Added - Page Titles to Login, Logout and Urls Page - Added Inspect Page, which displays information about a URL and allows to delete it - Added Inspect Form group to Urls that redirects to Inspect Page +- Added Docker-Multiplatform support (future images will contain linux/amd64 and linux/arm64 images) +- Added alpine images ## Changed diff --git a/Dockerfile b/Dockerfile index 712231c..6929a1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,19 @@ #See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +ARG BASE=8.0 +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:$BASE AS base USER app WORKDIR /app EXPOSE 8080 -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["JustShortIt.csproj", "."] RUN dotnet restore "./././JustShortIt.csproj" COPY . . WORKDIR "/src/." +ARG TARGETPLATFORM RUN dotnet build "./JustShortIt.csproj" -c $BUILD_CONFIGURATION -o /app/build FROM build AS publish