build: docker 镜像支持 NETCore 3.0

This commit is contained in:
Argo Zhang 2019-09-29 16:53:35 +08:00
parent 2d7cf3ded5
commit c464ffe754
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
2 changed files with 4 additions and 10 deletions
src/admin/Bootstrap.Admin

View File

@ -1,11 +1,11 @@
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat
FROM microsoft/dotnet:2.2-aspnetcore-runtime-nanoserver-1803 AS base
FROM microsoft/dotnet:3.0-aspnetcore-runtime-nanoserver-1903 AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/dotnet:2.2-sdk-nanoserver-1803 AS build
FROM microsoft/dotnet:3.0-sdk-nanoserver-1903 AS build
WORKDIR /src
COPY src/admin .
@ -16,7 +16,4 @@ RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
COPY --from=publish ["/src/Bootstrap.Admin/BootstrapAdmin.db", "."]
COPY --from=publish ["/src/keys/Longbow.lic", "."]
COPY --from=publish ["/src/keys/appsettings.Production.json", "."]
ENTRYPOINT ["dotnet", "Bootstrap.Admin.dll"]

View File

@ -1,11 +1,11 @@
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0 AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/dotnet:2.2-sdk AS build
FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build
WORKDIR /src
COPY src/admin .
@ -16,7 +16,4 @@ RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
COPY --from=publish ["/src/Bootstrap.Admin/BootstrapAdmin.db", "."]
COPY --from=publish ["/src/keys/Longbow.lic", "."]
COPY --from=publish ["/src/keys/appsettings.Production.json", "."]
ENTRYPOINT ["dotnet", "Bootstrap.Admin.dll"]