6.3. 使用 oc从源部署应用程序
以下示例演示了如何使用 oc 部署 example-app 应用程序,该应用程序位于 redhat-developer/s2i-dotnetcore-ex GitHub 存储库的 {dotnet-branch} 分支上的 app 文件夹中:
步骤
创建新 OpenShift 项目:
$ oc new-project sample-project添加 ASP.NET Core 应用程序:
$ oc new-app --name=example-app 'dotnet:6.0-ubi8~https://github.com/redhat-developer/s2i-dotnetcore-ex#{dotnet-branch}' --build-env DOTNET_STARTUP_PROJECT=app监控构建的进度:
$ oc logs -f bc/example-app构建完成后查看部署的应用程序:
$ oc logs -f dc/example-app该应用现在可以在项目内访问。
可选 :使项目可以访问外部:
$ oc expose svc/example-app获取可共享 URL:
$ oc get routes