Search code examples
containerspodman

Is it possible to exclude a specific subdirectory from a podman volume mount?


For example, let's say you have a directory dir/ with an arbitrary number of subdirectories including dir/subdir/, and you want to mount dir/ to a podman container with every subdirectory also mounted except dir/subdir/.

Is this possible in podman? If so, is it possible to do this purely with the arguments of a podman run command?


Solution

  • Is not possible, the entire folder will be available inside the container.

    You can overcome this with permissions, acl or even symbolic links. In the last case, create a second folder with links pointing to only the folders you want to be available inside the container.