github.com/containerd/nerdctl@v1.7.7/docs/dir.md (about) 1 # nerdctl directory layout 2 3 ## Config 4 **Default**: `/etc/nerdctl/nerdctl.toml` (rootful), `~/.config/nerdctl/nerdctl.toml` (rootless) 5 6 The configuration file of nerdctl. See [`config.md`](./config.md). 7 8 Can be overridden with environment variable `$NERDCTL_TOML`. 9 10 This file is unrelated to the daemon config file `/etc/containerd/config.toml`. 11 12 ## Data 13 ### `<DATAROOT>` 14 **Default**: `/var/lib/nerdctl` (rootful), `~/.local/share/nerdctl` (rootless) 15 16 Can be overridden with `nerdctl --data-root=<DATAROOT>` flag. 17 18 The directory is solely managed by nerdctl, not by containerd. 19 The directory has nothing to do with containerd data root `/var/lib/containerd`. 20 21 ### `<DATAROOT>/<ADDRHASH>` 22 e.g. `/var/lib/nerdctl/1935db59` 23 24 `1935db9` is from `$(echo -n "/run/containerd/containerd.sock" | sha256sum | cut -c1-8)` 25 26 This directory is also called "data store" in the implementation. 27 28 ### `<DATAROOT>/<ADDRHASH>/containers/<NAMESPACE>/<CID>` 29 e.g. `/var/lib/nerdctl/1935db59/containers/default/c4ed811cc361d26faffdee8d696ddbc45a9d93c571b5b3c54d3da01cb29caeb1` 30 31 Files: 32 - `resolv.conf`: mounted to the container as `/etc/resolv.conf` 33 - `hostname`: mounted to the container as `/etc/hostname` 34 - `log-config.json`: used for storing the `--log-opts` map of `nerdctl run` 35 - `<CID>-json.log`: used by `nerdctl logs` 36 - `oci-hook.*.log`: logs of the OCI hook 37 38 ### `<DATAROOT>/<ADDRHASH>/names/<NAMESPACE>` 39 e.g. `/var/lib/nerdctl/1935db59/names/default` 40 41 Files: 42 - `<NAME>`: contains the container ID (CID). Represents that the name is taken by that container. 43 44 Files must be operated with a `LOCK_EX` lock against the `<DATAROOT>/<ADDRHASH>/names/<NAMESPACE>` directory. 45 46 ### `<DATAROOT>/<ADDRHASH>/etchosts/<NAMESPACE>/<CID>` 47 e.g. `/var/lib/nerdctl/1935db59/etchosts/default/c4ed811cc361d26faffdee8d696ddbc45a9d93c571b5b3c54d3da01cb29caeb1` 48 49 Files: 50 - `hosts`: mounted to the container as `/etc/hosts` 51 - `meta.json`: metadata 52 53 Files must be operated with a `LOCK_EX` lock against the `<DATAROOT>/<ADDRHASH>/etchosts` directory. 54 55 ### `<DATAROOT>/<ADDRHASH>/volumes/<NAMESPACE>/<VOLNAME>/_data` 56 e.g. `/var/lib/nerdctl/1935db59/volumes/default/foo/_data` 57 58 Data volume 59 60 ## CNI 61 62 ### `<NETCONFPATH>` 63 **Default**: `/etc/cni/net.d` (rootful), `~/.config/cni/net.d` (rootless) 64 65 Can be overridden with `nerdctl --cni-netconfpath=<NETCONFPATH>` flag and environment variable `$NETCONFPATH`. 66 67 Files: 68 - `nerdctl-<NWNAME>.conflist`: CNI conf list created by nerdctl