Files
iled-shop/docker/Dockerfile.api
T
miczek 9854f84298
continuous-integration/drone/push Build is failing
fix(docker): cross-compile API image without QEMU SDK
dotnet restore under emulated arm64 aborts on the amd64 runner;
build on BUILDPLATFORM and publish with -a TARGETARCH instead.
2026-10-15 04:55:48 +03:00

21 lines
654 B
Docker

# syntax=docker/dockerfile:1
# Build on the runner arch (amd64); publish for TARGETARCH (arm64 on Pi).
# Avoids QEMU-emulated dotnet restore, which aborts under plugins/docker --platform.
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG TARGETARCH
WORKDIR /src
COPY src/backend/ .
RUN dotnet restore iLED.slnx -a $TARGETARCH
RUN dotnet publish src/iLED.Api/iLED.Api.csproj \
-c Release \
-o /app/publish \
-a $TARGETARCH \
--no-restore
FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
COPY --from=build /app/publish .
EXPOSE 8080
ENV ASPNETCORE_URLS=http://+:8080
ENTRYPOINT ["dotnet", "iLED.Api.dll"]