Skip to content

No possibility to set a system-wide rootless storage.conf #476

@Cornichon622

Description

@Cornichon622

Hello, I am trying to configure my home server so that each service runs under its own Linux user inside a Podman container. To maximize my drives' longevity, I want to put the graphroot in a tmpfs (/run/user/$UID/graphroot) and the imagestore in the home dir of the user (so that I don't need to pull all the images at every reboot), important data being stored in bind mounts elsewhere. Indeed some services I run keep writing unimportant data all day long, unnecessarily wearing the drives.

Ideally, I would have /etc/containers/storage.conf specify all of this in a generic fashion, for instance (this is what I would like to do, not an actual working config):

[storage]
driver = "overlay"
graphroot = "/run/user/$UID/graphroot"
imagestore = "$HOME/imagestore

However this applies mainly to the root user (only the driver parameter is used by rootless Podman here). There is a rootless_storage_path option to set a generic graphroot path for rootless users system-wide, in which I could write /run/user/$UID/graphroot, but a similar option does not seem to exist for imagestore.

Since this option does not exist, I would have to write imagestore = "$HOME/imagestore" in $HOME/.config/containers/storage.conf for every single user. However, the mere existence of this file makes rootless Podman ignore /etc/containers/storage.conf, which means I have to repeat graphroot and driver in $HOME/.config/containers/storage.conf for every single user too.

There is a last hurdle: I can't just write imagestore = "$HOME/imagestore" in $HOME/.config/containers/storage.conf because this field does not support environment variable substitution (whereas graphroot does). That means I must write imagestore = /home/username/imagestore (that is, hardcode the user's home directory) and cannot use the exact same generic file which I would copy/paste for every user.

To sum up there are three problems here:

  • in the system config, there's no way to specify a default value for rootless users for all parameters, only rootless_storage_path is available to specify a rootless graphroot.
  • having $HOME/.config/containers/storage.conf makes rootless Podman ignore /etc/containers/storage.conf completely, even for parameters which are specified in /etc but not in $HOME. I would expect the config in $HOME to inherit the config in /etc/, which would also solve the first problem.
  • imagestore does not support environment variable substitution like graphroot or rootless_storage_path do.

Thank you for your time!

Metadata

Metadata

Assignees

Labels

storageRelated to "storage" package

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions