fix: correct case statement syntax in TARGETARCH -> RID mapping

The previous inline case statement was missing proper variable assignment.
Use 'case' to set DOTNET_RID directly instead of trying to capture output
of a command substitution that contained a multi-branch case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-03 17:19:53 +08:00
co-authored by Claude Opus 4.8
parent 7a12b929dd
commit 05efe5e125
+5 -1
View File
@@ -24,7 +24,11 @@ ENV HTTP_PROXY=${HTTP_PROXY} \
# resolve to the correct platform. Framework-dependent output — apphost stays
# at /p:UseAppHost=false.
ARG TARGETARCH
RUN DOTNET_RID=$(case "$TARGETARCH" in amd64) echo linux-x64 ;; arm64) echo linux-arm64 ;; *) echo "unknown: $TARGETARCH" >&2; exit 1 ;; esac) ; \
RUN case "$TARGETARCH" in \
amd64) DOTNET_RID=linux-x64 ;; \
arm64) DOTNET_RID=linux-arm64 ;; \
*) echo "ERROR: unknown TARGETARCH=$TARGETARCH" >&2; exit 1 ;; \
esac ; \
echo "Building for TARGETARCH=$TARGETARCH -> RID=$DOTNET_RID"
COPY . .