我有一个必须为.NET Core 3.1应用创建docker映像的要求。为此,我有这个docker文件。谁能帮助我创建用于创建docker映像的.gitlab-ci.yml
文件并将其部署到Linux上的docker?
Docker文件
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-nanoserver-1809 AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-nanoserver-1809 AS build
WORKDIR /src
COPY ./Service/ .
RUN dotnet restore "Service/Service.csproj"
COPY . .
WORKDIR "/src/Hervice"
RUN dotnet build "Service.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Service.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Service.dll"]