Try using cross compile instead of emulation
Docker Build and Release Upload / build (push) Failing after 3s
Docker Build and Release Upload / build (push) Failing after 3s
This commit is contained in:
@@ -18,7 +18,7 @@ jobs:
|
||||
|
||||
- name: build server
|
||||
run: |
|
||||
docker build --build-arg BASE_URL=https://mistox.com -t mistox-website .
|
||||
docker buildx build --platform=linux/amd64,linux/arm64 --build-arg BASE_URL=https://mistox.com -t mistox-website .
|
||||
|
||||
- name: publish database
|
||||
run: |
|
||||
|
||||
+13
-2
@@ -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 ##
|
||||
|
||||
Reference in New Issue
Block a user