Containerds

Ubuntu22.04でNFS_Homeで rootless containerdを試す

背景

私はNFS homeを利用している。NFS上にコンテナを置けないトラブルへのTIPSについて残しておく。 またログが~/.local/share/nerdctl配下に書き出されるが、NFS上にログが書き出されると非常に重くなってしまうので別の場所をしていするようにした

chown ができない、というエラーが出る

error: failed to solve: failed to compute cache key: mount callback failed on /var/lib/containerd/tmpmounts/containerd-mount2455064670: failed to Lchown "/var/lib/containerd/tmpmounts/containerd-mount2455064670/etc/gshadow" for UID 0, GID 42: lchown /var/lib/containerd/tmpmounts/containerd-mount2455064670/etc/gshadow: operation not permitted: unknown

NFSの場合、rootlessが動作しない、ようだ

rootless containerdはデフォルトでホームディレクトリ配下を使用するが、私がNFS Homeだったので動作しなかった。

Redhatのエントリが参考になる。 Rootless Podman and NFS

Why doesn’t Podman support storage on NFS?
The use case that does not work well is having the container image store reside on an NFS mount point.
ンテナイメージをNFS上に置くのは良くないらしい。

The NFS protocol has no concept of user namespaces and has no way to know that the process running as UID 1000 is in one.
The NFS server also has no way of knowing that the client process has DAC_OVERRIDE for the user namespace and that UID 100059 is mapped into the same user namespace.
In other words, the chance of this information being known by NFS is slim at best.

NFSサーバ側はクライアント側で DAC_OVERRIDE しようとしているかなど分からない(NFSはサポートしていない機能なので仕方がない)

解決策としては2つのアプローチが紹介されている。

Read more...