1

有谁知道如何免费获得我的 minishift 项目的 AspNetCore 3.0 图像。先感谢您。

4

1 回答 1

0

我不确定我是否正确理解了您的问题,但此处提供了 Microsoft 的 ASP.NET Core Runtime 容器映像:https ://hub.docker.com/_/microsoft-dotnet-core-aspnet/

docker pull mcr.microsoft.com/dotnet/core/aspnet:3.1

让镜像在 OpenShift 上运行有点棘手,因为容器镜像使用端口 80。所以要部署示例应用程序,我们需要添加额外的步骤来创建ServiceAccount和分配SCC

# Deploy the DeploymentConfig
oc new-app --name aspnetcore-sample mcr.microsoft.com/dotnet/core/samples:aspnetapp

# Create a ServiceAccount, give it the "anyuid" SCC and assign it to the DeploymentConfig
oc create serviceaccount aspnetcore-sample-sa
oc adm policy add-scc-to-user anyuid -z aspnetcore-sample-sa
oc set serviceaccount dc aspnetcore-sample aspnetcore-sample-sa

# Expose the application to the outside world via a route
oc expose dc aspnetcore-sample --port=80
oc expose service aspnetcore-sample

# See the route with the following command
oc get route
于 2020-04-29T19:28:57.523 回答