From 63eff5f9f7dcd1e5ada9bc727f4a43e91fe0718e Mon Sep 17 00:00:00 2001 From: MASES Public Developers Team <94312179+masesdevelopers@users.noreply.github.com> Date: Wed, 15 May 2024 00:39:23 +0200 Subject: [PATCH] Update Dockerfile.linux --- src/container/Dockerfile.linux | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/container/Dockerfile.linux b/src/container/Dockerfile.linux index 526d92e4ba..2837b210ec 100644 --- a/src/container/Dockerfile.linux +++ b/src/container/Dockerfile.linux @@ -1,16 +1,17 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build-env +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build-env +ARG TARGETARCH WORKDIR /app # Copy everything COPY ./src/net ./ ENV JNET_DOCKER_BUILD_ACTIONS=true # Restore as distinct layers -RUN dotnet restore JNetDocker.sln +RUN dotnet restore JNetDocker.sln -a $TARGETARCH # Build and publish a release -RUN dotnet publish ./JNetCLI/JNetCLI.csproj --framework net8.0 -c Release -o out +RUN dotnet publish ./JNetCLI/JNetCLI.csproj --framework net8.0 -c Release -o out -a $TARGETARCH # Build runtime image -FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/runtime:8.0-jammy # Add JRE RUN apt-get update && apt-get install -y --no-install-recommends openjdk-17-jre-headless && rm -rf /var/lib/apt/lists/*