How to configure JupyterHub server to launch JupyterLab containers as Privileged

Hello Friends:

I need JupyterHub to launch JupyterLab containers in privileged mode. So in jupyterhub_config.py (the HUB configuration file, not the LAB configuration file), I added the following entry:

c.DockerSpawner.extra_host_config = {
           "privileged" : True,
           "devices"    : ["/sys/fs/cgroup:/sys/fs/cgroup:ro",],
           "tmpfs"      : {"/tmp":"", "/run":"", "/run/lock":""}, }

After implementing that (and restarting), and then launching a LAB server, I don’t see a --privileged option in the output of docker ps --no-trunc. As well, the output of docker inspect jupyter-jdoe | grep -i priv shows Privileged as false.

Does anyone know how to properly implement this? I think I’m close, but I need help.

Thank you!

Sigh! I determined what the issue was. The above is correct. The issue is that, while I correctly set c.DockerSpawner.extra_host_config as shown, I accidentally clobbered that dict() later in the code by overwriting it versus .update()ing it. :clown_face: Apologies for the false alarm. Hoping others find the question and method useful though. :blush: