linux:podman

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
linux:podman [2025/03/30 10:57] – [コンテナ内のカラーが微妙に違う...🤔どうでもいいけど...😅] ともやんlinux:podman [2025/09/28 13:23] (現在) – [Error: cannot re-exec process to join the existing user namespace エラーが発生する💩🤪] ともやん
行 497: 行 497:
 気になる人のために...😉\\ 気になる人のために...😉\\
 <WRAP color_term> <WRAP color_term>
-<WRAP color_command><html><pre class=BSc+<WRAP color_command><html><pre> 
-<font color="#0087FF"><b>$</b></font> <font color="#26A269">buildah</font> u<font color="#999999">nshare</font>                                                     +<font color="#0087FF"><b>$</b></font> <font color="#26A269">buildah</font> u<font color="#999999">nshare</font> 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre class=BSc>
 <font color="#5F00FF">┌──(</font><font color="#F66151"><b>root 💀 highway-x</b></font><font color="#5F00FF">)-[</font><b>~/</b><font color="#5F00FF">]</font> <font color="#5F00FF">┌──(</font><font color="#F66151"><b>root 💀 highway-x</b></font><font color="#5F00FF">)-[</font><b>~/</b><font color="#5F00FF">]</font>
 <font color="#5F00FF">└─</font><font color="#F66151"><b>#</b></font> <font color="#26A269">exit</font> <font color="#5F00FF">└─</font><font color="#F66151"><b>#</b></font> <font color="#26A269">exit</font>
-                                                                                                                  +</pre></html></WRAP> 
 +<WRAP color_command><html><pre>
 <font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> fedora <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> tomoyan596/fedora41-minimal-zsh zsh <font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> fedora <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> tomoyan596/fedora41-minimal-zsh zsh
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre class=BSc>
 ┌──(<font color="#F66151"><b>root 💀 dedcd1106d29</b></font>)-[<b>~</b>] ┌──(<font color="#F66151"><b>root 💀 dedcd1106d29</b></font>)-[<b>~</b>]
 └─<font color="#F66151"><b>#</b></font> <font color="#26A269">exit</font> └─<font color="#F66151"><b>#</b></font> <font color="#26A269">exit</font>
 </pre></html></WRAP> </pre></html></WRAP>
-<WRAP color_command><html><pre class=BSc>+<WRAP color_command><html><pre>
 <font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> fedora <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> <font color="#A347BA">-e</font> <font color="#A2734C">&quot;TERM=$TERM&quot;</font> tomoyan596/fedora41-minimal-zsh zsh <font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> fedora <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> <font color="#A347BA">-e</font> <font color="#A2734C">&quot;TERM=$TERM&quot;</font> tomoyan596/fedora41-minimal-zsh zsh
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre class=BSc>
 <font color="#5F00FF">┌──(</font><font color="#F66151"><b>root 💀 d6d67305079a</b></font><font color="#5F00FF">)-[</font><b>~</b><font color="#5F00FF">]</font> <font color="#5F00FF">┌──(</font><font color="#F66151"><b>root 💀 d6d67305079a</b></font><font color="#5F00FF">)-[</font><b>~</b><font color="#5F00FF">]</font>
 <font color="#5F00FF">└─</font><font color="#F66151"><b>#</b></font> <font color="#5F00FF">└─</font><font color="#F66151"><b>#</b></font>
 </pre></html></WRAP> </pre></html></WRAP>
 Or Or
-<WRAP color_command><html><pre class=BSc>+<WRAP color_command><html><pre>
 <font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> fedora <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> <font color="#A347BA">-e</font> <font color="#A2734C">&quot;TERM=xterm-256color&quot;</font> tomoyan596/fedora41-minimal-zsh zsh <font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> fedora <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> <font color="#A347BA">-e</font> <font color="#A2734C">&quot;TERM=xterm-256color&quot;</font> tomoyan596/fedora41-minimal-zsh zsh
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre class=BSc>
 <font color="#5F00FF">┌──(</font><font color="#F66151"><b>root 💀 d6d67305079a</b></font><font color="#5F00FF">)-[</font><b>~</b><font color="#5F00FF">]</font> <font color="#5F00FF">┌──(</font><font color="#F66151"><b>root 💀 d6d67305079a</b></font><font color="#5F00FF">)-[</font><b>~</b><font color="#5F00FF">]</font>
 <font color="#5F00FF">└─</font><font color="#F66151"><b>#</b></font> <font color="#5F00FF">└─</font><font color="#F66151"><b>#</b></font>
行 532: 行 541:
 一先ず ''-e "TERM=$TERM"'' で運用😅\\ 一先ず ''-e "TERM=$TERM"'' で運用😅\\
 <WRAP color_term> <WRAP color_term>
-<WRAP color_command><html><pre class=BSc>+<WRAP color_command><html><pre>
 <font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> openwrt_builder <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> <font color="#A347BA">-v</font> <font color="#2A7BDE"><b>`</b></font><font color="#26A269">pwd</font><font color="#2A7BDE"><b>`</b></font>/openwrt:/home/tomoyan/openwrt tomoyan596/openwrt_builder zsh  <font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> openwrt_builder <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> <font color="#A347BA">-v</font> <font color="#2A7BDE"><b>`</b></font><font color="#26A269">pwd</font><font color="#2A7BDE"><b>`</b></font>/openwrt:/home/tomoyan/openwrt tomoyan596/openwrt_builder zsh 
 </pre></html></WRAP> </pre></html></WRAP>
-<WRAP color_result><html><pre>+<WRAP color_result><html><pre class=BSc>
 ┌──(<b>tomoyan   d72536ea41c9</b>)-[<b>~</b>] ┌──(<b>tomoyan   d72536ea41c9</b>)-[<b>~</b>]
 └─<b>$</b> <font color="#26A269">exit</font> └─<b>$</b> <font color="#26A269">exit</font>
 </pre></html></WRAP> </pre></html></WRAP>
-<WRAP color_command><html><pre class=BSc>+<WRAP color_command><html><pre>
 <font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> openwrt_builder <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> <font color="#A347BA">-v</font> <font color="#2A7BDE"><b>`</b></font><font color="#26A269">pwd</font><font color="#2A7BDE"><b>`</b></font>/openwrt:/home/tomoyan/openwrt <font color="#A347BA">-e</font> <font color="#A2734C">&quot;TERM=</font><font color="#A347BA">$TERM</font><font color="#A2734C">&quot;</font> tomoyan596/openwrt_builder zsh <font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> run <font color="#A347BA">--name</font> openwrt_builder <font color="#A347BA">--rm</font> <font color="#A347BA">-ti</font> <font color="#A347BA">-v</font> <font color="#2A7BDE"><b>`</b></font><font color="#26A269">pwd</font><font color="#2A7BDE"><b>`</b></font>/openwrt:/home/tomoyan/openwrt <font color="#A347BA">-e</font> <font color="#A2734C">&quot;TERM=</font><font color="#A347BA">$TERM</font><font color="#A2734C">&quot;</font> tomoyan596/openwrt_builder zsh
 </pre></html></WRAP> </pre></html></WRAP>
-<WRAP color_result><html><pre>+<WRAP color_result><html><pre class=BSc>
 <font color="#00FFFF">┌──(</font><font color="#0087FF"><b>tomoyan   f300a11c5dff</b></font><font color="#00FFFF">)-[</font><b>~</b><font color="#00FFFF">]</font> <font color="#00FFFF">┌──(</font><font color="#0087FF"><b>tomoyan   f300a11c5dff</b></font><font color="#00FFFF">)-[</font><b>~</b><font color="#00FFFF">]</font>
 <font color="#00FFFF">└─</font><font color="#0087FF"><b>$</b></font>  <font color="#00FFFF">└─</font><font color="#0087FF"><b>$</b></font> 
行 2220: 行 2229:
 [[git>containers/podman/issues/9137|podman rootless causes Error: cannot re-exec process · Issue #9137 · containers/podman]]\\ [[git>containers/podman/issues/9137|podman rootless causes Error: cannot re-exec process · Issue #9137 · containers/podman]]\\
 issues は閉じているが再現性はありそう...🤔\\ issues は閉じているが再現性はありそう...🤔\\
 +
 +原因のまとめ🤔 by [[https://grok.com/|Grok]]\\
 +主な原因はルートレスPodmanの仕組み(ユーザーネームスペース、cgroup v2、OCIランタイムのcrun/runc)で、以下のような要因:\\
 +  * **pause.pidの残骸**: Podmanのルートレス実行で/run/user/$UID/libpod/tmp/pause.pidが残ると、再実行時に名前空間に参加できずエラー。
 +  * **systemdセッションの不整合**: XDG_RUNTIME_DIRやsystemd-logindのセッションが不完全(Incusやツールボックス内のネスト実行で発生しやすい)。
 +  * **ユーザーネームスペースの無効化**: ホストのカーネル設定(kernel.unprivileged_userns_clone=0)で無効になってる場合。
 +  * **ネストコンテナ環境**: Incusやsystemd-nspawn内でPodmanを実行すると、ネスト設定(security.nesting)が不足。
 +  * **仕様変更の影響**: Podman 4.9.x以降でルートレス処理が強化され、Fedora 42やUbuntu 24.04.2の組み合わせでエラーが増えた。以前の環境(例: Podman 4.3.1)では問題なかったのはこのため。
 +
 +結論: pause.pidの残骸を削除する🤔\\
 +<WRAP color_term>
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> info
 +</pre></html></WRAP>
 +<WRAP color_result><html><pre>
 +Error: cannot re-exec process to join the existing user namespace
 +</pre></html></WRAP>
 +<WRAP color_command><html><pre>
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">rm</font> /run/user/<font color="#A347BA">$</font><font color="#12488B"><b>(</b></font><font color="#26A269">id</font> <font color="#A347BA">-u</font><font color="#12488B"><b>)</b></font>/libpod/tmp/pause.pid
 +<font color="#0087FF"><b>$</b></font> <font color="#26A269">podman</font> info
 +</pre></html></WRAP>
 +<WRAP color_result_hlong><html><pre>
 +host:
 +  arch: amd64
 +  buildahVersion: 1.41.4
 +  cgroupControllers:
 +  - cpu
 +  - io
 +  - memory
 +  - pids
 +  cgroupManager: systemd
 +  cgroupVersion: v2
 +  conmon:
 +    package: conmon-2.1.13-1.fc42.x86_64
 +    path: /usr/bin/conmon
 +    version: &apos;conmon version 2.1.13, commit: &apos;
 +  cpuUtilization:
 +    idlePercent: 88.42
 +    systemPercent: 2.59
 +    userPercent: 8.99
 +</pre></html></WRAP>
 +</WRAP>
 +
 +=== 古い対処の経緯🤕 ===
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
行 7071: 行 7124:
 [[https://www.redhat.com/sysadmin/speeding-container-buildah|Speeding up container image builds with Buildah | Enable Sysadmin]]\\ [[https://www.redhat.com/sysadmin/speeding-container-buildah|Speeding up container image builds with Buildah | Enable Sysadmin]]\\
 [[https://stackoverflow.com/questions/57776452/is-it-possible-to-map-a-user-inside-the-docker-container-to-an-outside-user|linux - Is it possible to map a user inside the docker container to an outside user? - Stack Overflow]]\\ [[https://stackoverflow.com/questions/57776452/is-it-possible-to-map-a-user-inside-the-docker-container-to-an-outside-user|linux - Is it possible to map a user inside the docker container to an outside user? - Stack Overflow]]\\
 +[[https://kinsta.com/blog/dockerfile-entrypoint/|Dockerfile ENTRYPOINT: Everything You Need To Know]]\\
  
 ==== 付録 ==== ==== 付録 ====
  • linux/podman.1743299872.txt.gz
  • 最終更新: 2025/03/30 10:57
  • by ともやん