Images with 60 or more layers fail to start: "mount …/rootfs: No such file or directory"
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- docker, linux, rust
調査の方向性
Start with mount_rootfs in crates/kiri-init/src/linux/container.rs and inspect how it builds overlayfs mount options. The report identifies the 4 KiB mount option limit and says the Linux engine needs a fallback for older kernels; it also describes a branch that uses the newer mount API and a test mounting 120 layers. Done means the 60 layer repro starts, the 120 layer test passes, and older Linux kernels retain the fallback.
索引モデルが issue の本文から書いたものです。
説明
Kiri version and system
0.2.1 built from the v0.2.1 tag (0.2.0 release does the same) on macOS 27.2 (Apple silicon)
What you did
I hit this with nixos/nix, which has 69 layers. Here's a smaller repro:
mkdir layers65 && cd layers65
{ echo "FROM alpine:3.22"; for i in $(seq 1 64); do echo "RUN echo $i > /layer-$i"; done; } > Dockerfile
docker build -t layers65 .
docker run --rm layers65 cat /layer-64
and
docker run --rm nixos/nix:2.34.9 nix --version
What happened
docker: Error response from daemon: run <id>: mount /var/lib/kiri/containers/<id>/rootfs: No such file or directory (os error 2)
What you expected instead
The container starts. Both work on Docker and OrbStack.
Anything else
It's exactly at 60: with 59 layers (alpine plus 58 RUN lines) the image
starts, with 60 it doesn't.
I think it's the mount options getting too long. mount_rootfs
(crates/kiri-init/src/linux/container.rs:406) puts every layer in one
lowerdir= string, and each layer is a 64-character hash, so about 65
bytes per layer. mount(2) only copies one page (4 KiB) of options, so
around 60 layers the string gets cut off in the middle of a name and
overlayfs can't find that directory.
The guest kernel is 6.18, so the newer mount API can take each layer
separately with lowerdir+ (6.8 and later), which goes up to overlayfs's
own limit of 500. I've got that working on a branch, with a fallback to
the current mount(2) call for older kernels on the Linux engine and a
test that mounts 120 layers. nixos/nix runs with it. Happy to open a PR
if you'd like it done that way.
- 主要言語
- Rust
- スター
- 7.5k
- フォーク
- 329
- 平均マージ
- 7時間 48分
- マージ済み PR(30日)
- 105
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
libracoder/kiri のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
libracoder/kiri#364 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
libracoder/kiri#289 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 47/100
libracoder/kiri#365 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
libracoder/kiri#362 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 47/100
libracoder/kiri#359 ·
メンテナーはふだん 1 日以内に返信
libracoder/kiri の issue をすべて見る
似ている issue
-
benchmark-review
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
メンテナーはふだん 1 日以内に返信
-
area:filesystem bug need-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Captions panel does not offer to show an existing transcript対応中かも @thedavidweng が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
CapSoftware/Cap#4276 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
matrix-org/matrix-rust-sdk#7495 ·
メンテナーはふだん 1 日以内に返信