Skip to content

Add iproute2 for rootless Docker + retry flaky aider installs (stage 2 of #77) - #110

Open
YuseiIto wants to merge 2 commits into
mainfrom
claude/pr-77-review-2a3gan
Open

YuseiIto wants to merge 2 commits into
mainfrom
claude/pr-77-review-2a3gan

Conversation

@YuseiIto

@YuseiIto YuseiIto commented Jul 3, 2026

Copy link
Copy Markdown
Owner

背景

#107(rootless ツール導入)→ イメージ再ビルド後、#77 の CI は rootless デーモンの起動を実際に検証できるようになり、原因の切り分けが進みました:

  1. newuidmap 不在Install rootless Docker tooling on Debian-family hosts (stage 1 of #77) #107 で解決
  2. newuidmap: write to uid_map failed: Operation not permitted → カーネルの map_write() が uid_map を開いたプロセスに child namespace への CAP_SYS_ADMIN を要求するため。コンテナ内では setuid バイナリも bounding set 以上には昇格できず、Docker デフォルトには SYS_ADMIN が無い。→ Replace host Docker socket bind with rootless docker-in-docker #77 側で --cap-add SYS_ADMIN を追加済み(ローカルで setpriv により再現・特定)
  3. 今回: nsenter: failed to execute ip: No such file or directory — rootlesskit は slirp4netns の tap デバイスを namespace 内で ip(8) を実行して設定するが、イメージに iproute2 が無い

変更内容

  • mitamae/cookbooks/docker/default.rb: rootless 前提パッケージに iproute2 を追加
  • mitamae/cookbooks/aider/default.rb: aider インストーラを3回リトライに変更。本日 PyPI(files.pythonhosted.org)からのダウンロードが「broken pipe」で切断され、無関係なイメージビルドジョブが4回落ちたため(本 PR の pine/arm64・LXC bamboo の失敗もこれ)。一時障害1回でビルド全体が落ちないようにする

もう一つのランタイム依存である iptablesdocker-ce が hard-depend しているため追加不要(確認済み: Depends: containerd.io, docker-ce-cli, iptables, nftables, ...)。

進め方

#107 と同じ2段階方式です。本 PR を先にマージ → build.yaml がイメージを再ビルド → #77 の CI を再実行すると、rootless デーモンの起動から docker run hello-world までがエンドツーエンドで検証されます。

確認

  • rubocop: 105 files inspected, no offenses

🤖 Generated with Claude Code

https://claude.ai/code/session_01QYryuMeKDCxgJro93GJxWB

YuseiIto pushed a commit that referenced this pull request Jul 3, 2026
The prebuilt image now ships iproute2 (#110), which rootlesskit needs
to configure the slirp4netns tap device.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QYryuMeKDCxgJro93GJxWB
@YuseiIto YuseiIto changed the title Add iproute2 for rootless Docker tap device setup (stage 2 of #77) Add iproute2 for rootless Docker + retry flaky aider installs (stage 2 of #77) Jul 4, 2026
@YuseiIto
YuseiIto force-pushed the claude/pr-77-review-2a3gan branch 2 times, most recently from 471e492 to 6fa6c76 Compare July 4, 2026 05:27
With the rootless tooling from #107 in place, the devcontainer's
rootless daemon (#77) now gets as far as network setup and dies there:
rootlesskit configures the slirp4netns tap device by running ip(8)
inside the namespace, and the image has no iproute2 —
'nsenter: failed to execute ip: No such file or directory'.

Same staging as #107: land the package on main first so the prebuilt
images pick it up, then #77's CI can exercise the daemon end to end.
iptables, the other runtime dependency of the daemon, needs no entry
here because docker-ce already hard-depends on it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QYryuMeKDCxgJro93GJxWB
@YuseiIto
YuseiIto force-pushed the claude/pr-77-review-2a3gan branch from 6fa6c76 to ecaa40b Compare July 4, 2026 05:27
Network installers that pipe curl into a shell (and release-tarball
downloads) flake mid-transfer during CI image builds — connection
reset / broken pipe against PyPI, GitHub, etc. Rather than hand-roll a
retry loop in each cookbook, add a reusable retriable_command define to
lib/custom_resources.rb that reads like execute (command + optional
not_if/only_if guard, tunable retries/delay) and wraps the command in a
POSIX-sh retry loop.

Convert the aider cookbook, whose PyPI dependency resolution is the
current repeat offender, to use it. Other curl|sh cookbooks (ollama,
starship, uv, ...) can adopt it incrementally.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QYryuMeKDCxgJro93GJxWB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants