Mounting volumes and podman

here is the error i’m getting when jupyterhub is trying use the mounted volume. I need to mount notebooks and .local as my install is restricted and the root volume of container is read only.

From container logs:
traitlets.traitlets.TraitError: No such directory: ‘’/jupyterhub-users/spokrand/notebook’’

wondering if the double single quotes are causing the problem. but the config looks correct!

NOTEBOOK_DIR = ‘/home/jovyan/work’
USER_NOTEBOOK_DIR = “/jupyterhub-users/”+username+“/notebook”
c.DockerSpawner.volumes = {
f’{USER_NOTEBOOK_DIR}': NOTEBOOK_DIR,
}

The jupyterhub_config.py is evaluated once at startup. Since you want your volumes to be dynamically named you’ll need to use the {username} template expansion, see
https://jupyterhub-dockerspawner.readthedocs.io/en/latest/api/index.html#dockerspawner.DockerSpawner.volumes
and maybe DockerSpawner.mounts depending on exactly what you want to do.

Also be aware Podman host volumes behave differently from Docker volumes, e.g. host volume directories aren’t automatically created.