Try using cross compile instead of emulation
Docker Build and Release Upload / build (push) Failing after 3s

This commit is contained in:
2025-07-10 18:12:27 -07:00
parent 34e4328050
commit 75fb6592f6
2 changed files with 14 additions and 3 deletions
+13 -2
View File
@@ -27,7 +27,7 @@ RUN ng build --base-href=${BASE_URL}
## Build Backend ##
#####################
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-backend
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build-backend
WORKDIR /src
# Copy the csproj
@@ -39,8 +39,19 @@ RUN dotnet restore './MistoxWebsite.Server.csproj'
# Copy the rest of the backend over
COPY ./src/MistoxWebsite.Server/ ./
# Get the target arch
ARG TARGETOS TARGETARCH
# Build the source
RUN dotnet publish './MistoxWebsite.Server.csproj' -c Release -o /app/publish
RUN if [ $TARGETARCH = "arm64" ]; then \
RID="arm64" \
elif [ "$TARGETARCHARCH" = "amd64" ]; then \
RID="x64" \
else \
echo "Unsupported ARCH: $ARCH" \
exit 1 \
fi \
dotnet publish './MistoxWebsite.Server.csproj' -c Release -r $TARGETOS-$RID -o /app/publish
################
## Publish ##