forked from OctoconDev/octocon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.bootstrapper
More file actions
29 lines (27 loc) · 1.19 KB
/
Copy pathDockerfile.bootstrapper
File metadata and controls
29 lines (27 loc) · 1.19 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
# syntax=docker/dockerfile:1.7
#
# Cross-RID build for the `interfold-bootstrap` self-contained ELF. SDK stage
# is pinned to $BUILDPLATFORM so per-arch publishes cross-compile natively
# (no QEMU). PublishProfile XMLs under
# tools/Interfold.Bootstrapper/Properties/PublishProfiles/ own the
# SelfContained / Trim / single-file settings — this file is just the wrapper.
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 tools/Interfold.Bootstrapper \
--configuration Release \
--runtime "$RID" \
/p:PublishProfile="$RID" && \
mkdir -p /out && \
cp "tools/Interfold.Bootstrapper/bin/Release/net10.0/$RID/publish/interfold-bootstrap" /out/
# `scratch` so `--output=type=local` extracts only the binary, no rootfs noise.
FROM scratch AS out
COPY --from=build /out/interfold-bootstrap /interfold-bootstrap