6.6. 创建 MVC 示例应用程序
s2i-dotnetcore-ex 是 .NET 的默认 Model, View, Controller (MVC)模板应用程序。
此应用程序被 .NET S2I 镜像用作示例应用程序,并可使用 Try Example 链接直接从 OpenShift UI 创建。
也可以使用 OpenShift 客户端二进制文件(oc)创建应用。
步骤
使用 oc 创建示例应用程序:
添加 .NET 应用程序:
oc new-app dotnet:6.0-ubi8~https://github.com/redhat-developer/s2i-dotnetcore-ex#{dotnet-branch} --context-dir=app$ oc new-app dotnet:6.0-ubi8~https://github.com/redhat-developer/s2i-dotnetcore-ex#{dotnet-branch} --context-dir=appCopy to Clipboard Copied! Toggle word wrap Toggle overflow 使应用程序可以被外部访问:
oc expose service s2i-dotnetcore-ex
$ oc expose service s2i-dotnetcore-exCopy to Clipboard Copied! Toggle word wrap Toggle overflow 获取 sharable URL:
oc get route s2i-dotnetcore-ex
$ oc get route s2i-dotnetcore-exCopy to Clipboard Copied! Toggle word wrap Toggle overflow