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
Copy to Clipboard Toggle word wrap

このアプリケーションの詳細は、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
Copy to Clipboard Toggle word wrap

このアプリケーションの詳細は、https://github.com/redhat-developer/s2i-dotnetcore-persistent-ex/tree/dotnetcore-3.1 を参照してください。

バグの報告

トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat