2.6. サンプルアプリケーション
.NET Core s2I ビルダーでは、2 つのサンプルアプリケーションを使用できます。
2.6.1. s2i-dotnetcore-ex リンクのコピーリンクがクリップボードにコピーされました!
s2i-dotnetcore-ex は、デフォルトの .NET Core MVC テンプレートアプリケーションです。
このアプリケーションは、.NET Core s2i イメージによってサンプルアプリケーションとして使用され、Try Example リンクを使用して OpenShift UI から直接作成できます。
アプリケーションは、OpenShift クライアントバイナリー (oc) を使用して作成することもできます。
# Add the .NET Core application
$ oc new-app dotnet:3.1~https://github.com/redhat-developer/s2i-dotnetcore-ex#dotnetcore-3.1 --context-dir=app
# Make the .NET Core application accessible externally and show the url
$ oc expose service s2i-dotnetcore-ex
$ oc get route s2i-dotnetcore-ex
このアプリケーションの詳細は、https://github.com/redhat-developer/s2i-dotnetcore-ex/tree/dotnetcore-3.1 を参照してください。
2.6.2. s2i-dotnetcore-persistent-ex リンクのコピーリンクがクリップボードにコピーされました!
s2i-dotnetcore-persistent-ex は、PostgreSQL データベースにデータを格納する単純な CRUD .NET Core Web アプリケーションです。
アプリケーションは、次のように OpenShift クライアント oc を使用して作成できます。
# Add the database
$ oc new-app postgresql-ephemeral
# Add the .NET Core application
$ oc new-app dotnet:3.1~https://github.com/redhat-developer/s2i-dotnetcore-persistent-ex#dotnetcore-3.1 --context-dir app
# Add envvars from the the postgresql secret, and database service name envvar.
$ oc set env dc/s2i-dotnetcore-persistent-ex --from=secret/postgresql -e database-service=postgresql
# Make the .NET Core application accessible externally and show the url
$ oc expose service s2i-dotnetcore-persistent-ex
$ oc get route s2i-dotnetcore-persistent-ex
このアプリケーションの詳細は、https://github.com/redhat-developer/s2i-dotnetcore-persistent-ex/tree/dotnetcore-3.1 を参照してください。