我是Google App Engine的新成员,并试图将我的ASP.Net Core 3.1 Blazor网站部署到Google App Engine。我在Docker上使用了自定义版本,因为App Engine尚不支持.Net Core 3.1:
App.yaml
runtime: custom
env: flex
Dockerfile#由Visual Studio生成]
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1.3-bionic AS base WORKDIR /app EXPOSE 8080 EXPOSE 443 FROM mcr.microsoft.com/dotnet/core/sdk:3.1.201-bionic AS build WORKDIR /src COPY ["Blazor_SqLite_Publish/Blazor_SqLite_Publish.csproj", "Blazor_SqLite_Publish/"] RUN dotnet restore "Blazor_SqLite_Publish/Blazor_SqLite_Publish.csproj" COPY . . WORKDIR "/src/Blazor_SqLite_Publish" RUN dotnet build "Blazor_SqLite_Publish.csproj" -c Release -o /app/build FROM build AS publish RUN dotnet publish "Blazor_SqLite_Publish.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "Blazor_SqLite_Publish.dll"]
该网站已成功部署,甚至可以正常工作。但是我注意到,该App Engine实例在Ubuntu-16.04.6 LTS上运行我的docker映像:
root@xxxxxxxxxxx:/app# cat /etc/os-release NAME="Ubuntu" VERSION="16.04.6 LTS (Xenial Xerus)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 16.04.6 LTS" VERSION_ID="16.04"
但是我希望Ubuntu-18.04 LTS。
如何将Ubuntu-16.04.6 LTS版本更改为Ubuntu-18.04 LTS?
我是Google App Engine的新成员,并试图将我的ASP.Net Core 3.1 Blazor网站部署到Google App Engine。我在Docker上使用了自定义版本,因为App Engine不支持.Net Core 3.1 ...
最后,我能够解决此问题。感谢breddy,它检查了我的Dockerfile。