forked from OctoconDev/octocon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (27 loc) · 1.04 KB
/
Copy pathDockerfile
File metadata and controls
30 lines (27 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# syntax=docker/dockerfile:1.7
#
# Multi-arch image for ghcr.io/azyyyyyy/interfold-api. SDK stage is pinned to
# $BUILDPLATFORM so `dotnet publish -r linux-$ARCH` cross-publishes natively
# (no QEMU); publish now lives here, not in CI, so each per-arch runtime image
# gets its own RID assets.
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG TARGETARCH
WORKDIR /src
COPY . .
RUN --mount=type=cache,id=nuget,target=/root/.nuget/packages,sharing=locked \
case "$TARGETARCH" in \
amd64) RID=linux-x64 ;; \
arm64) RID=linux-arm64 ;; \
arm) RID=linux-arm ;; \
*) echo "Unsupported TARGETARCH: $TARGETARCH" >&2; exit 1 ;; \
esac && \
dotnet publish hosts/Interfold.Api.Host/Interfold.Api.Host.csproj \
--configuration Release \
--runtime "$RID" \
--self-contained false \
-p:UseAppHost=false \
--output /publish
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
WORKDIR /app
COPY --from=build /publish/ .
ENTRYPOINT ["dotnet", "Interfold.Api.Host.dll"]