# containerd v2.2.1

2025-12-18 · [元のリリースノート](https://github.com/containerd/containerd/releases/tag/v2.2.1) · [全体のまとめ](https://ratatosk.io/ja/releases/containerd/v2.2.1)

セキュリティ 1 · 破壊的変更 3 · 重大な修正 9 · 機能・改善 17 · 依存関係の更新 29 · その他の変更 34

## アップグレード前の確認事項

### 前提条件

- **推奨される containerd リリースアーカイブ**: 推奨される `containerd-<VERSION>-<OS>-<ARCH>.tar.gz` アーカイブは、Ubuntu 22.04 で使用されているバージョンの glibc 2.35 に動的リンクされています。
  > * `containerd-<VERSION>-<OS>-<ARCH>.tar.gz`:         ✅Recommended. Dynamically linked with glibc 2.35 (Ubuntu 22.04).
- **containerd と併せた runc のインストール**
  > In addition to containerd, typically you will have to install [runc](https://github.com/opencontainers/runc/releases)
- **CNI プラグインのインストール要件**: CNI プラグインも通常、公式サイトからインストールする必要があります。
  > and [CNI plugins](https://github.com/containernetworking/plugins/releases) from their official sites too.

## セキュリティ (1)

### CRI イメージ RPC のエラーログで URL クエリパラメーターをマスキング

- 影響対象: CRI の `PullImage`、`ListImages`、`ImageStatus`、`RemoveImage` RPC (推定)

これらのRPCで `*url.Error` を含むエラーが発生した場合、ログに記録されるエラー内のクエリパラメーターはマスキングされた値に置き換えられます。それ以外のエラーは `SanitizeError` によって変更されずに返されます。

> * Redact all query parameters in CRI error logs ([#12546](https://github.com/containerd/containerd/pull/12546))
>   * [`c707f771a`](https://github.com/containerd/containerd/commit/c707f771a872f9dd22ad8f2f827317a800e4a74f) fix: redact all query parameters in CRI error logs
> * **Redact all query parameters in CRI error logs** ([#12546](https://github.com/containerd/containerd/pull/12546))

## 破壊的変更 (3)

### Darwin での `ctr pull` の既定プラットフォームを Linux に変更

- 影響対象: Darwin 上で `--platform` を省略し、`--all-platforms` を使用しない `ctr pull` の実行

従来、これらの pull では展開時の既定プラットフォームが Darwin でした。しかし、Darwin イメージは定義されておらず、既定のスナップショッターと differ がサポートするのは Linux のみです。

根拠: “// Use linux by default for unpacking images on darwin as configured by transfer service” https://github.com/containerd/containerd/pull/12544

> * **Fix image defaults on Darwin to usable configuration** ([#12544](https://github.com/containerd/containerd/pull/12544))

### 非 Linux プラットフォームでの EROFS 書き込み可能レイヤーのデフォルト容量を 64 MiB に変更

- 影響対象: 非 Linux プラットフォームの EROFS snapshotter

割り当て量は、ユーザー設定またはスナップショットごとに調整できます。

>   * [`9da97686d`](https://github.com/containerd/containerd/commit/9da97686d151da046d5512bb9f7f1d67ea4c8393) Use default writable size in erofs snapshotter for non-Linux hosts

### NRI stub のロガー設定と `Logger()` インターフェースメソッドの追加

- 影響対象: NRI stub の `Stub` インターフェースを実装するアプリケーション (推定)

従来、stub はグローバルロガーを使用していたため、ライブラリとして利用するアプリケーションは、構造体のメンバーを通じてその stub のログ設定をカスタマイズできませんでした。

根拠: “Previously, the stub package used a global logger instance, making it difficult for applications using the stub as a library to customize logging behavior, by using `nrilog.Set()`” https://github.com/containerd/nri/pull/239

> * feat: Make logger a configurable struct member for stub ([containerd/nri#239](https://github.com/containerd/nri/pull/239))
>   * [`08a891a`](https://github.com/containerd/nri/commit/08a891a81d90b03b5e5ae14734f5ad74e74c264b) feat: Make logger a configurable struct member for stub

## 重大な修正 (9)

### Darwin 転送サービスの既定の展開方式を Linux に変更

- 影響対象: 既定の展開設定を使用する Darwin 転送サービス

設定では `defaults.DefaultSnapshotter` と `defaults.DefaultDiffer` を使用します。

> * **Fix image defaults on Darwin to usable configuration** ([#12544](https://github.com/containerd/containerd/pull/12544))
> * Fix image defaults on Darwin to usable configuration ([#12544](https://github.com/containerd/containerd/pull/12544))
>   * [`d154e234b`](https://github.com/containerd/containerd/commit/d154e234b29c5bed4f14a72d605e92e4728415a2) Update the ctr pull defaults when using the transfer service

### Linux以外のEROFSスナップショッターにおける書き込み可能レイヤーのサイズ既定値を64 MiBに修正

- 影響対象: 書き込み可能レイヤーのサイズを上書き指定していない、Linux以外のEROFSスナップショッター

> * **Fix image defaults on Darwin to usable configuration** ([#12544](https://github.com/containerd/containerd/pull/12544))

### Darwin EROFS 差分作成時のブロックサイズを4096バイトに設定

- 影響対象: Darwin での EROFS 差分作成時に、`mkfsExtraOpts` に `-b` で始まるオプションがない場合

そのオプションがないと、使用できないブロックサイズが使われる可能性がありました。デフォルトの `-b4096` が挿入されるようになりました。

> * **Fix image defaults on Darwin to usable configuration** ([#12544](https://github.com/containerd/containerd/pull/12544))

### `WithMediaTypeKeyPrefix` で発生し得るパニックの修正

- 影響対象: キー接頭辞マップがすでにコンテキストに含まれている状態での `WithMediaTypeKeyPrefix` の呼び出し (推定)

コンテキストにマップがすでに含まれている場合、関数はそのマップを直接使用していました。現在は複製したマップを使用します。

> * **Fix possible panic from WithMediaTypeKeyPrefix** ([#12516](https://github.com/containerd/containerd/pull/12516))
> * Fix possible panic from WithMediaTypeKeyPrefix ([#12516](https://github.com/containerd/containerd/pull/12516))
>   * [`8b73c2de3`](https://github.com/containerd/containerd/commit/8b73c2de310e95fe3a143473b511fcf99d03692f) remotes: fix possible panic from WithMediaTypeKeyPrefix
> </p>
> </details>

### 同梱 `runc` の tmpfs `mode=` に関する回帰の修正

- 影響対象: `mode=` 引数を指定した `runc` の tmpfs マウントを使用するワークロード

以前は、対象パスが存在するかどうかにかかわらず、tmpfs マウントに `mode=` が適用されていました。更新された `runc` でこの回帰が修正されました。

> * **Update runc binary to v1.3.4** ([#12593](https://github.com/containerd/containerd/pull/12593))
> * Update runc binary to v1.3.4 ([#12593](https://github.com/containerd/containerd/pull/12593))
>   * [`fb5b818a9`](https://github.com/containerd/containerd/commit/fb5b818a9a34ad4fe3b0901c73cd7432ae4bb8bc) runc: Update runc binary to v1.3.4

### HugeTLB の `Failcnt` 解析の修正

- 影響対象: cgroup v2 の HugeTLB 統計を `hugetlb.<size>.events` ファイルから取得する構成 (推定)

`Failcnt` は、HugeTLB の割り当て失敗を記録する `max` エントリーから取得するようになりました。

> * **Fix parsing of hugetlb.<size>.events files** ([containerd/cgroups#379](https://github.com/containerd/cgroups/pull/379))
> * Fix parsing of hugetlb.<size>.events files ([containerd/cgroups#379](https://github.com/containerd/cgroups/pull/379))
>   * [`2ad7a12`](https://github.com/containerd/cgroups/commit/2ad7a1241827ef1bc4f964fe8a5248b073f2db82) hugetlb: correctly parse hugetlb.<size>.events files

### Darwin の転送サービスで Linux 向けの展開をデフォルト化

- 影響対象: 転送サービスのデフォルトの展開設定を使用する Darwin 環境

デフォルト設定では `defaults.DefaultSnapshotter` と `defaults.DefaultDiffer` を使用します。

>   * [`09364216d`](https://github.com/containerd/containerd/commit/09364216de92aab056118507da59fabf642d88ac) Fix transfer unpack defaults on darwin

### Darwin での EROFS ブロックサイズのデフォルト追加

- 影響対象: `-b` オプションを指定しない macOS の EROFS 差分作成

この構成で EROFS の差分を作成する際、使用できないブロックサイズが使われることがありました。Darwin では、既存のオプションが `-b` で始まらない限り、`mkfs.erofs` に `-b4096` が渡されるようになりました。

>   * [`eeb0f889a`](https://github.com/containerd/containerd/commit/eeb0f889aed826b58a3033a5a5b14dff6ccd1979) Update default erofs block size on macOS during erofs diff

### NRI サンプルロガーの起動失敗の修正

- 影響対象: `--events` に明示的な値を指定していない NRI サンプルロガーの構成 (推定)

Pod 更新イベントの導入後、`--events` に明示的な値を指定していない場合、ロガーは `all` を既定値として起動に失敗し、未処理の `UpdatePodSandbox,PostUpdatePodSandbox` イベントを報告していました。現在はイベントマスクを未設定のままにし、スタブが購読対象を決定するようになりました。

> * plugins/logger: fix default event subscription mask. ([containerd/nri#158](https://github.com/containerd/nri/pull/158))
>   * [`33b1db1`](https://github.com/containerd/nri/commit/33b1db1add2e9a603f7c47e1efa95d386f4af560) logger: fix default event subscription mask.

## 機能・改善 (17)

- NRI プラグインに渡される Linux セキュリティプロファイル
- Linux RDT 制約の NRI プラグインへの引き渡し
- NRI プラグインに渡される Linux ネットワークデバイス
- Linux スケジューラー属性の NRI プラグインへの引き渡し
- NRI プラグインへの Linux I/O 優先度の受け渡し
- `HTTPStatusCodeAttributes` によるレスポンスステータスコード属性の追加
- NRI WASM サポートのコンパイル時無効化 (利用条件: `nri_no_wasm` ビルドタグ)
- NRI プラグインによる Intel RDT 設定の調整と削除 (利用条件: ランタイムのフィールド別対応状況: `closID` は runc と crun、`schemata` は runc の今後の v1.4 と crun v1.22+、`enableMonitoring` は runc の今後の v1.4 に対応し、crun v1.24+ は非対応)
- プラグイン向けカスタム NRI ソケットパスのオプション (利用条件: `socket-path` フラグ、differ プラグインの `socketPath` 設定フィールド)
- 任意の文字列コレクション向け `OptionalRepeatedString` の NRI API への追加
- コンテナーのカーネルスケジューリングポリシー属性に対する NRI のサポート
- NRI プラグインによる Linux ネットワークデバイスの調整と挿入 (利用条件: `LinuxNetDevice` に対応した OCI ランタイム（`runc` や `crun` など）)
- NRI による sysctl 調整への対応
- `SpecGenerator` がカスタム `UnderlyingGenerator` 実装を受け入れる
- NRI コンテナー API でコンテナーのユーザー ID とグループ ID を公開
- NRI プラグインイメージの署名 (利用条件: プルリクエスト以外のイベントによってトリガーされたワークフロー実行)
- containerd/nri モジュールの Go バージョン要件引き下げ

## 依存関係の更新 (29)

ほか29件（いずれもセキュリティへの言及なし）

- `` * [`01d5490ae`](https://github.com/containerd/containerd/commit/01d5490ae26a05b1a73ca9e253761005c7286754) go.{mod,sum}: bump NRI deps to v0.11.0, re-vendor. ``
- `` * go.{mod,sum}: bump CDI deps to v1.1.0. ([#12664](https://github.com/containerd/containerd/pull/12664)) * [`c166a577d`](https://github.com/containerd/containerd/commit/c166a577d0638de704d6c9f999858ed47cf06a60) go.{mod,sum} bump CDI deps to v1.1.0. ``
- `` * go.mod: containerd/zfs v2.0.0; remove exclude rules ([#12654](https://github.com/containerd/containerd/pull/12654)) * [`73a08aa00`](https://github.com/containerd/containerd/commit/73a08aa00dc98a0662a40d45ed50dac534dce1e6) go.mod: remove exclude rules * [`cee08c8af`](https://github.com/containerd/containerd/commit/cee08c8af836002863b30e2ef8cd3c45b6ae56ad) build(deps): bump github.com/containerd/zfs/v2 from 2.0.0-rc.0 to 2.0.0 ``
- `` * go.mod: github.com/containernetworking/plugins v1.9.0 ([#12658](https://github.com/containerd/containerd/pull/12658)) * [`8a5fc8641`](https://github.com/containerd/containerd/commit/8a5fc86416926d2a2189861391cd77b07d7f4443) go.mod: github.com/containernetworking/plugins v1.9.0 ``
- `` * go.mod: golang.org/x/crypto v0.45.0 ([#12638](https://github.com/containerd/containerd/pull/12638)) * [`55c93d6fb`](https://github.com/containerd/containerd/commit/55c93d6fb85333d4988122b2ae97b947bcde02b7) go.mod: golang.org/x/crypto v0.45.0 ``
- `` * ci :bump Go 1.24.11, 1.25.5 ([#12625](https://github.com/containerd/containerd/pull/12625)) * [`aedd29bb4`](https://github.com/containerd/containerd/commit/aedd29bb4ecabfae1d8806dc1011a347a3401fb2) ci: bump Go 1.24.11, 1.25.5 * [`26628f139`](https://github.com/containerd/containerd/commit/26628f1397f991a9ee2fe7de32a6a2df70ab89bd) ci: bump Go 1.24.10, 1.25.4 * [`8bb0e9be6`](https://github.com/containerd/containerd/commit/8bb0e9be6ceebc1ad1d76c88a661bacf84921b3d) ci(release): set GO_VERSION in Dockerfile ``
- `` * : update containerd/cgroups from v3.1.0 to v3.1.2 ([#12598](https://github.com/containerd/containerd/pull/12598)) * [`51582ed27`](https://github.com/containerd/containerd/commit/51582ed27b13941f6bbf1526d909a00deadfcc0f) bump containerd/cgroups to v3.1.2 * [`50d0e4fd4`](https://github.com/containerd/containerd/commit/50d0e4fd4cb909829d9965d9da5be04ee812fe29) build(deps): bump github.com/containerd/cgroups/v3 from 3.1.0 to 3.1.1 ``
- `` * build(deps): bump github.com/opencontainers/selinux ([#12589](https://github.com/containerd/containerd/pull/12589)) * [`e3bf2b80b`](https://github.com/containerd/containerd/commit/e3bf2b80b9ca3280fd64a2bd0436fcdb894c4410) build(deps): bump github.com/opencontainers/selinux ``
- `` * go.mod: github.com/opencontainers/runtime-spec v1.3.0 ([containerd/cgroups#376](https://github.com/containerd/cgroups/pull/376)) * [`34ef430`](https://github.com/containerd/cgroups/commit/34ef430d727e569c31b4f2bbc7d83bffeb1c0165) go.mod: github.com/opencontainers/runtime-spec v1.3.0 ``
- `` * update wazero/wazero version to v1.10.1 ([containerd/nri#252](https://github.com/containerd/nri/pull/252)) * [`9eb9a0f`](https://github.com/containerd/nri/commit/9eb9a0f0f6e223e6060805b55957f117f159f5cc) update tetratelabs/wazero version to v1.10.1 ``
- `` * deps: bump runtime-spec to v1.3.0. ([containerd/nri#243](https://github.com/containerd/nri/pull/243)) * [`29c5811`](https://github.com/containerd/nri/commit/29c581117267cb5d2289ff08902a93ff263caf0e) (v0.1.0) examples: lock NRI, runtime spec deps. * [`d812952`](https://github.com/containerd/nri/commit/d8129529588cca090c972aa5e5f7775162af59da) v010-adapter: lock NRI, runtime spec and tools deps. * [`7dd7c7f`](https://github.com/containerd/nri/commit/7dd7c7f8b21c08242de41634b12ab2ee71b91000) api,runtime-tools: adjust for runtime-spec v1.3.0. * [`5d5d4c4`](https://github.com/containerd/nri/commit/5d5d4c4c877fdef4fe0938e627b11b97234195b8) go.{mod,sum}: update runtime-tools, runtime-spec to v1.3.0. ``
- `` * go.mod: update to stable containerd v2.0 ([containerd/zfs#89](https://github.com/containerd/zfs/pull/89)) * [`f11f891`](https://github.com/containerd/zfs/commit/f11f891ff42b3f8cd6f15d0fb18b2644a002bb85) go.mod: update to stable containerd v2.0 ``
- `* **github.com/containerd/cgroups/v3**                  v3.1.0 -> v3.1.2`
- `* **github.com/containerd/nri**                         v0.10.0 -> v0.11.0`
- `* **github.com/containerd/zfs/v2**                      v2.0.0-rc.0 -> v2.0.0`
- `* **github.com/containernetworking/plugins**            v1.8.0 -> v1.9.0`
- `* **github.com/cyphar/filepath-securejoin**             v0.5.1 **_new_**`
- `* **github.com/opencontainers/runtime-spec**            v1.2.1 -> v1.3.0`
- `* **github.com/opencontainers/runtime-tools**           0ea5ed0382a2 -> edf4cb3d2116`
- `* **github.com/opencontainers/selinux**                 v1.12.0 -> v1.13.1`
- `* **github.com/tetratelabs/wazero**                     v1.9.0 -> v1.10.1`
- `* **golang.org/x/crypto**                               v0.41.0 -> v0.45.0`
- `* **golang.org/x/net**                                  v0.43.0 -> v0.47.0`
- `* **golang.org/x/sync**                                 v0.17.0 -> v0.18.0`
- `* **golang.org/x/sys**                                  v0.37.0 -> v0.38.0`
- `* **golang.org/x/term**                                 v0.34.0 -> v0.37.0`
- `* **golang.org/x/text**                                 v0.28.0 -> v0.31.0`
- `* **tags.cncf.io/container-device-interface**           v1.0.1 -> v1.1.0`
- `* **tags.cncf.io/container-device-interface/specs-go**  v1.0.0 -> v1.1.0`

## その他の変更 (34)

- Darwin の diff サービスにおけるデフォルトの differ 設定
- v2.2.1 リリースノートの準備
- NRI 調整が nil の場合に `WithContainerAdjustment` で spec 生成をスキップ
- Runtime v2 gRPC クライアントで OpenTelemetry stats handler を採用
- CI CIFuzz アクションの Ubuntu 24.04 対応
- core/mount の autoclear テストとエラー報告の更新
- `window-2022` の Windows CI でスキップされる critest の 5 件のケース
- Darwin のデフォルト差分実装設定の更新
- Docker フェッチリーダーの `ReadAt` 実装の差し戻し
- cgroups CI の lint 設定の更新
- `hugePageSizes` でのディレクトリクローズの延期
- cgroup1 と cgroup2 の RDMA キーと値の解析に `strings.Cut` を使用
- メモリテストでのド・モルガンの法則の適用と明示的な型の省略
- cgroups ビルドワークフローの `actions/checkout` 6 への更新
- 詳細モードでのデバイスインジェクターの注入サマリーのログ出力
- 適応テストヘルパーにおけるプラグイン同期の追加
- 空の `main()` と `init()` での WASM サンプルプラグイン登録
- Makefile の `build-proto` によるプロトコルファイルの常時再生成
- CPU・メモリリソースを設定した状態で開始する適応テスト
- NRI による `build/tools` からの `protoc` とプラグインのインストールおよび使用
- NRI のメモリ・CPU リソース調整処理のリファクタリング
- OCI フックを使ったコンテナ単位の RDT モニタリング用 Kustomize サンプル
- NRI lint 設定による `QF1008` 警告の無効化
- NRI CIの`golangci-lint`をv2.4に更新
- NRI ソースへの `nolint` ディレクティブの追加
- NRI のエクスポートシンボルに関するコメントの追加・修正
- NRI ジェネレーターのマウント順ソートに昇格メソッドとフィールドを使用
- `.idea` の除外設定の差し戻しと、グローバル `.gitignore` へのコメント追加
- リポジトリの `.gitignore` に `.idea` を追加
- NRI lint ディレクティブの整理と標準化
- API／protobuf ビルド用の `build-proto-dockerized` ターゲット
- containerd/zfs の CI ワークフローと lint の更新
- `containerd/zfs` の lint 整理とレシーバー名の統一
- containerd/zfs のスナップショットサイズ上限エラーの大文字・小文字を修正

---

整理した内容は AI が作成するため誤っている可能性があり、無保証で提供されます。
