1.新建一个WebApi项目,并添加Dockerfile文件: FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base WORKDIR /app EXPOSE FROM microsoft/dotnet:2.1-sdk AS build WORKDIR /src Copy . . RUN dotnet restore RUN dotnet build -c Release -o /app FROM build as publish RUN dot…