我正在尝试将我的 asp net swagger 部署到托管 VPS 中,但出现错误:警告:请求的图像平台(linux/arm64)与检测到的主机平台(linux/amd64/v3)不匹配,并且没有
我正在尝试将我的 asp net swagger 部署到托管 VPS 中,但出现错误:警告:请求的图像平台(linux/arm64)与检测到的主机平台(linux/amd64/v3)不匹配,并且未请求特定平台
Dockerfile:
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["MerchantApi/MerchantApi.csproj", "MerchantApi/"]
RUN dotnet restore "./MerchantApi/MerchantApi.csproj"
COPY . .
WORKDIR /src/MerchantApi
RUN dotnet build "./MerchantApi.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
RUN dotnet publish "./MerchantApi.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
# Собираем финальный образ
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "MerchantApi.dll"]