Communityコーディング&開発github.com

ローカルキットを使用したバリアントのビルド

ローカル開発レジストリに公開されたキットを使用してBottlerocketバリアントイメージをビルドし、開発検証を行います。

ローカルキットを使用したバリアントのビルド とは?

このスキルは、Bottlerocketのカスタムバリアントイメージをローカルで開発・テストするための手順を提供します。開発者はまず`build-kit-locally`スキルでキットをローカルレジストリに公開し、その後本スキルを使用して実際のバリアントイメージをビルドします。これにより、キットの変更を本番レジストリに公開する前に、エンドツーエンドで検証できます。対応プラットフォームはBottlerocket開発環境とTwoliterツールチェインで、手順は`brdev twoliter use-local-deps`でのローカルレジストリ設定、`Twoliter.toml`でのキットソース指定、ロックファイルの更新、そして`cargo make`でのビルド実行までを含みます。テスト終了後は`brdev twoliter use-upstream-deps`で元の設定に戻すことで、クリーンな状態を維持できます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/cbgbt/bottlerocket-forest/tree/main/skills/build-variant-from-local-kits

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

スキル: ローカルキットを使用したバリアントのビルド

目的

ローカル開発レジストリに公開されたキットを使用して、完全なBottlerocketバリアントイメージをビルドします。これにより、本番レジストリに公開する前に、キットの変更をエンドツーエンドでテストできます。

使用するタイミング

  • キットの変更を完全なバリアントビルドでテストする場合
  • ローカルテスト用の起動可能イメージを作成する場合
  • キットの変更をエンドツーエンドで検証する場合

前提条件

  • キットがすでにローカルレジストリにビルド・公開されている(build-kit-locally スキルを使用)
  • ローカルレジストリが実行中である
  • Bottlerocketバリアントリポジトリ

手順

1. ローカルレジストリ用に設定

cd ./bottlerocket
brdev twoliter use-local-deps

これにより、キットを取得するためのローカルレジストリを指す Twoliter.override が作成されます。

2. ローカルで取得するキットを選択

Twoliter.toml を編集し、ローカルレジストリから取得したいキットに vendor = "local" を設定します。

[kit.bottlerocket-core-kit]
vendor = "local"  # ローカルレジストリから取得
version = "2.0.0"

[kit.bottlerocket-kernel-6.1-kit]
# vendor のオーバーライドなし - アップストリームを使用
version = "2.0.0"

vendor = "local" が設定されたキットのみがローカルレジストリから取得され、それ以外はアップストリームを使用します。

3. ロックファイルを更新

./tools/twoliter/twoliter update

4. バリアントをビルド

cargo make

特定のバリアントの場合:

cargo make -e BUILDSYS_VARIANT=aws-k8s-1.31

特定のアーキテクチャの場合:

cargo make -e BUILDSYS_ARCH=aarch64

5. ビルドされたイメージを確認

ls -lh build/images/*.img

検証

ビルドが正常に完了し、build/images/ に .img ファイルが生成される必要があります。

クリーンアップ

テストが終了したら、アップストリーム設定に戻します。

brdev twoliter use-upstream-deps

これにより Twoliter.override が削除されます。 Twoliter.toml 内の vendor = "local" の変更も元に戻すのを忘れないでください。

よくある問題

レジストリにキットが見つからない:

エラー: キットのプルに失敗しました

解決策: brdev registry list でキットが公開されていることを確認してください。

バージョンの不一致: 解決策: Twoliter.toml のバージョンが公開されたキットのバージョンと一致していることを確認してください。

ロックファイルの同期が取れていない: 解決策: ./tools/twoliter/twoliter update を再度実行してください。

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

ad-hoc-implementation-plan

Transform a rough plan into implement-commit ready artifacts. Allows rigorous review while implementing.

build-kit-locally

Build a kit and publish it to a locally hosted registry for development testing

deep-research

Create educational documents that build understanding progressively with citations

edit-spec-file

Edit Bottlerocket RPM spec files following project style conventions

fact-find

Quick lookup of specific facts about Bottlerocket with citations

idea-honing

Clarify feature ideas through iterative Q&A, recording insights to guide concept development

implement-commit

Implement commits from an implementation plan using a TDD pipeline

local-registry

Start and manage a local OCI registry for Bottlerocket kit development

prepare-core-kit-release

Prepare bottlerocket-core-kit for release by bumping version and updating changelog

propose-feature-concept

Create a new feature concept document to pitch the idea and explain the problem/solution

propose-feature-design

Create or update feature technical design document with architecture and implementation guidance

propose-feature-requirements

Create or update feature requirements specification using EARS notation with examples and appendices

propose-feature-test-plan

Create a test plan mapping EARS requirements and Critical Constraints to specific tests

propose-implementation-plan

Create an implementation plan with atomic commits that build toward a complete feature

review-code

Deep code review generating PR comments via principled question-driven analysis

review-scope

Verify code changes match intended scope and requirements without exceeding boundaries

review-style

Verify code follows project style guides without providing improvement suggestions

test-local-twoliter

Build and test local changes to twoliter before releasing

update-twoliter

Update all Bottlerocket repositories to a new Twoliter version

関連スキル