liveBook · Manning

Storage.conf

As explained in Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more

storage.conf is a configuration file that defines container storage locations and storage-driver settings for Podman and related container tools.

storage.conf configures the containers/storage library used by Podman to store image layers, containers, and filesystem data. It controls storage locations and storage-driver behavior, while other Podman defaults belong to separate configuration files. section 5.1 section 5.5

Podman reads one applicable file: a user configuration takes precedence over system configuration, which takes precedence over the distribution default. Rootless users typically use $HOME/.config/containers/storage.conf, while rootful configuration commonly resides at /etc/containers/storage.conf; remote Podman uses the Linux machine’s files. section 5.1

Storage location settings distinguish rootful and rootless operation:

  • Rootless Podman defaults to $HOME/.local/share/containers/storage. section 5.1.1
  • Rootful Podman defaults to /var/lib/containers/storage; graphroot can relocate it, such as to /var/mystorage. section 5.1.1
  • rootless_storage_path changes the rootless location system-wide and supports $HOME and $UID expansion. section 5.1.1
  • Relocated directories require appropriate SELinux file-context handling with semanage and restorecon. section 5.1.1

Podman uses overlay by default; in Podman, this name refers to the newer overlay2 implementation. Advanced [storage.options.overlay] settings include mount_program, mountopt, ignore_chown_errors, size, inode, and force_mask. fuse-overlayfs can provide userspace mounting when rootless native overlay is unavailable. section 5.1.2

Relocate rootful storage

Copy the distribution configuration, edit graphroot, and verify the active path: sudo cp /usr/share/containers/storage.conf /etc/containers/storage.conf; set graphroot = "/var/mystorage"; run sudo podman info and inspect graphRoot and volumePath. section 5.1.1

$ podman info --format '{{ .Store.ConfigFile }}'
/home/dwalsh/.config/containers/storage.conf

Use podman info to identify the exact storage.conf file active for the current Podman invocation. section 5.1

How Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more covers it

How deep it goes
Explains file precedence, rootful and rootless paths, relocation, SELinux labeling, and selected overlay options; defers exhaustive fields to the man page.
Examples
Demonstrates graphroot relocation, rootless_storage_path customization, podman info inspection, and SELinux relabeling commands.
What it assumes
Assumes Linux paths, rootful versus rootless operation, SELinux labeling, and basic Podman commands; identifies user namespaces as a separate system configuration concern.
What you can do after
Operate/configure Podman with relocated storage and verify the selected configuration, graphRoot, driver, and volume path.
How it connects
Connects containers/storage with rootless Podman, overlay filesystem, fuse-overlayfs, SELinux, and user namespaces.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more. The section links point to the parts of the book it draws on.