preset dotnet 重命名为 dotnet10

This commit is contained in:
2026-10-21 12:38:52 +08:00
parent 90ba3c435d
commit 437aba11c5
3 changed files with 8 additions and 8 deletions
+17
View File
@@ -0,0 +1,17 @@
# 多阶段构建:先在 SDK 里 self-contained 发布,最终镜像只保留 runtime + 发布产物
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
# 由 magic-docker 传入:--build-arg VERSION=<tag>
ARG VERSION=0.0.0
WORKDIR /src
# 构建上下文就是 context 目录
COPY . .
RUN dotnet publish -r linux-x64 -c Release --self-contained -o /out \
-p:AssemblyName=App -p:Version="$VERSION"
FROM mcr.microsoft.com/dotnet/runtime:10.0
ENV TZ Asia/Shanghai
COPY --from=build /out /home
WORKDIR /home
ENTRYPOINT ["./App"]