Create local host directories for volume bind mount implicitly? #24386
-
I have been getting familiar with Quadlets. With Docker this is handled implicitly for When providing a sample/reference Quadlet for your project or documentation, should the user be expected to create each local volume path themselves? Or would you add that into the Quadlet itself with something like this: # .config/containers/systemd/my-service.container
[Container]
# Map root ownership to rootless host user:
# - Triggers a `chown` copy of the container image content,
# in addition to mapping ownership for the volume.
# - GIDMap defaults to the same ID mapping as UIDMap.
UIDMap=+0:@%U
# Mount `~/volumes/my-service/some-dir` with SELinux compatibility:
Volume=%h/volumes/%N/some-dir:/some-dir:Z
[Service]
# Create the `Volume` location before starting the container:
ExecStartPre=mkdir -p %h/volumes/%N/some-dir With With Quadlets, these are always managed in common locations rather than ad-hoc? Would you distribute them similar to Just checking what the expectation is from the podman community side. Are users more likely to manually copy the equivalent Quadlet file(s) to the standard locations Quadlet uses, and thus also check each Volume definition to make these bind mounts? I am aware of named data volumes with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Using
|
Beta Was this translation helpful? Give feedback.
Using
ExecStartPre=
to create a directory sounds good to me.Just like you suggested above: