3.2. カスタムレジストリーイメージのビルド
本セクションでは、カスタム devfile およびプラグインレジストリーイメージを含むイメージをビルドする方法を説明します。この手順では、新規の devfile およびプラグインを追加する方法を説明します。devfile レジストリーイメージには、devfile で参照されるすべてのサンプルプロジェクトが含まれます。プラグインレジストリーイメージには、プラグインまたは拡張機能のメタデータが含まれます。
手順
devfile レジストリーリポジトリーのクローンを作成し、デプロイするバージョンをチェックアウトします。
$ git clone git@github.com:redhat-developer/codeready-workspaces.git $ cd codeready-workspaces $ git checkout crw-2.5-rhel-8
./dependencies/che-devfile-registry/devfiles/
ディレクトリーで、サブディレクトリー<devfile-name>/
を作成し、devfile.yaml
ファイルおよびmeta.yaml
ファイルを追加します。devfile のファイル編成
./dependencies/che-devfile-registry/devfiles/ └── <devfile-name> ├── devfile.yaml └── meta.yaml
-
devfile.yaml
ファイルに有効なコンテンツを追加します。devfile 形式の詳細については、https://access.redhat.com/documentation/en-us/red_hat_codeready_workspaces/2.5/html-single/end-user_guide/index#making-a-workspace-portable-using-a-devfile_crw を参照してください。 meta.yaml
ファイルが以下の構造に準拠していることを確認します。表3.1 devfile
meta.yaml
のパラメーター属性 詳細 description
ユーザーダッシュボードに表示される説明。
displayName
ユーザーダッシュボードに表示される名前。
globalMemoryLimit
devfile が起動するすべてのコンポーネントによって消費されることが予想されるメモリーの合計。この数字はユーザーダッシュボードに表示されます。これは情報を示唆するように提供されますが、CodeReady Workspaces サーバーでは考慮されません。
icon
ユーザーダッシュボードに表示される
.svg
ファイルへのリンクtags
タグの一覧。タグには通常、スタックに含まれるツールが含まれます。
例3.1 devfile の例
meta.yaml
displayName: Rust description: Rust Stack with Rust 1.39 tags: ["Rust"] icon: https://www.eclipse.org/che/images/logo-eclipseche.svg globalMemoryLimit: 1686Mi
./dependencies/che-devfile-registry/devfiles/
ディレクトリーで、サブディレクトリー<devfile-name>/
を作成し、devfile.yaml
ファイルおよびmeta.yaml
ファイルを追加します。devfile のファイル編成
./dependencies/che-devfile-registry/devfiles/ └── <devfile-name> ├── devfile.yaml └── meta.yaml
-
devfile.yaml
ファイルに有効なコンテンツを追加します。devfile 形式の詳細については、https://access.redhat.com/documentation/en-us/red_hat_codeready_workspaces/2.5/html-single/end-user_guide/index#making-a-workspace-portable-using-a-devfile_crw を参照してください。 meta.yaml
ファイルが以下の構造に準拠していることを確認します。表3.2 devfile
meta.yaml
のパラメーター属性 詳細 description
ユーザーダッシュボードに表示される説明。
displayName
ユーザーダッシュボードに表示される名前。
globalMemoryLimit
devfile が起動するすべてのコンポーネントによって消費されることが予想されるメモリーの合計。この数字はユーザーダッシュボードに表示されます。これは情報を示唆するように提供されますが、CodeReady Workspaces サーバーでは考慮されません。
icon
ユーザーダッシュボードに表示される
.svg
ファイルへのリンクtags
タグの一覧。タグには通常、スタックに含まれるツールが含まれます。
例3.2 devfile の例
meta.yaml
displayName: Rust description: Rust Stack with Rust 1.39 tags: ["Rust"] icon: https://www.eclipse.org/che/images/logo-eclipseche.svg globalMemoryLimit: 1686Mi
カスタム devfile レジストリーイメージをビルドします。
$ cd dependencies/che-devfile-registry $ ./build.sh --organization <my-org> \ --registry <my-registry> \ --tag <my-tag> \ --latest-only $ cd ../../dependencies/che-devfile-registry $ ./build.sh --organization <my-org> \ --registry <my-registry> \ --tag <my-tag> \ --latest-only
ヒントbuild.sh
スクリプトの詳細なオプションを表示するには--help
パラメーターを使用します。レジストリーイメージにプラグインバイナリーを含めるには、
--offline
パラメーターを追加します。