dockerfile测试例子
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM 127.0.0.1/basic/mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
FROM 127.0.0.1/basic/mcr.microsoft.com/dotnet/sdk:6.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["src/Services/Test.Service.AdminWeb.Api/Test.Service.AdminWeb.Api.csproj", "src/Services/Test.Service.AdminWeb.Api/"]
COPY ["src/BuildingBlocks/Test.Entities/Test.Entities.csproj", "src/BuildingBlocks/Test.Entities/"]
COPY ["src/BuildingBlocks/Test.Enums/Test.Enums.csproj", "src/BuildingBlocks/Test.Enums/"]
COPY ["src/BuildingBlocks/Test.Files/Test.Files.csproj", "src/BuildingBlocks/Test.Files/"]
COPY ["src/BuildingBlocks/Test.SqlSugars/Test.SqlSugars.csproj", "src/BuildingBlocks/Test.SqlSugars/"]
COPY ["src/BuildingBlocks/Test.Models/Test.Models.csproj", "src/BuildingBlocks/Test.Models/"]
COPY ["src/BuildingBlocks/Test.Utils/Test.Utils.csproj", "src/BuildingBlocks/Test.Utils/"]
COPY ["src/BuildingBlocks/Test.Web/Test.Web.csproj", "src/BuildingBlocks/Test.Web/"]
COPY ["src/BuildingBlocks/Test.Exceptions/Test.Exceptions.csproj", "src/BuildingBlocks/Test.Exceptions/"]
RUN dotnet nuget remove source nuget.org
RUN dotnet nuget add source https://127.0.0.1/repository/nuget-group/index.json -n "HNKC.nuget"
RUN dotnet restore "./src/Services/Test.Service.AdminWeb.Api/Test.Service.AdminWeb.Api.csproj"
COPY . .
WORKDIR "/src/src/Services/Test.Service.AdminWeb.Api"
RUN dotnet build "./Test.Service.AdminWeb.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./Test.Service.AdminWeb.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Test.Service.AdminWeb.Api.dll"]