![見出し画像](https://assets.st-note.com/production/uploads/images/129075837/rectangle_large_type_2_bf417ebcd7221f33e262b1b8e30dcb59.png?width=1200)
nerdctlディレクトリのレイアウト
Config
既定値: /etc/nerdctl/nerdctl.toml (rootful), ~/.config/nerdctl/nerdctl.toml (rootless)
nerdctlの設定ファイル。config.md を参照してください。
環境変数 $NERDCTL_TOML で上書きできます。
このファイルは、デーモン構成ファイル /etc/containerd/config.toml とは無関係です。
Data
<DATAROOT>
既定値: /var/lib/nerdctl (rootful), ~/.local/share/nerdctl (rootless)
nerdctl --data-root=<DATAROOT>フラグで上書きできます。
ディレクトリは、containerdではなく、nerdctlによってのみ管理されます。 このディレクトリは、containerd データルート /var/lib/containerd とは何の関係もありません。
<DATAROOT>/<ADDRHASH>
e.g. /var/lib/nerdctl/1935db59
1935db9 is from $(echo -n "/run/containerd/containerd.sock" | sha256sum | cut -c1-8)
このディレクトリは、実装の "data store" と呼んでいます。
<DATAROOT>/<ADDRHASH>/containers/<NAMESPACE>/<CID>
例 /var/lib/nerdctl/1935db59/containers/default/c4ed811cc361d26faffdee8d696ddbc45a9d93c571b5b3c54d3da01cb29caeb1
ファイル: - resolv.conf: mounted to the container as /etc/resolv.conf - hostname: mounted to the container as /etc/hostname - log-config.json: used for storing the --log-opts map of nerdctl run - <CID>-json.log: used by nerdctl logs - oci-hook.*.log: logs of the OCI hook
<DATAROOT>/<ADDRHASH>/names/<NAMESPACE>
例/var/lib/nerdctl/1935db59/names/default
ファイル: - <NAME>: contains the container ID (CID). そのコンテナーによって名前が取得されることを表します。
ファイルは、<DATAROOT>/<ADDRHASH>names/<NAMESPACE> ディレクトリに対してLOCK_EXロックを使用して操作する必要があります。
<DATAROOT>/<ADDRHASH>/etchosts/<NAMESPACE>/<CID>
例 /var/lib/nerdctl/1935db59/etchosts/default/c4ed811cc361d26faffdee8d696ddbc45a9d93c571b5b3c54d3da01cb29caeb1
ファイル: - hosts: mounted to the container as /etc/hosts - meta.json: metadata
Files must be operated with a LOCK_EX lock against the <DATAROOT>/<ADDRHASH>/etchosts directory.
<DATAROOT>/<ADDRHASH>/volumes/<NAMESPACE>/<VOLNAME>/_data
例/var/lib/nerdctl/1935db59/volumes/default/foo/_data
データ量
CNI
<NETCONFPATH>
既定値: /etc/cni/net.d (rootful), ~/.config/cni/net.d (rootless)
nerdctl --cni-netconfpath=<NETCONFPATH> フラグと環境変数 $NETCONFPATH で上書きできます。
ファイル: - nerdctl-<NWNAME>.conflist: CNI conf list created by nerdctl