LDAPAuthenticator - keep same UID and GID numbers in the user docker container

Hi, i have a “dockerized” jupyterhub, where jupyterhub and the jupyterlab notebooks are all its own docker container. We use LDAPAuthentication for access control, but the UID and GID numbers don’t match with the user in our Active Directory. This is a problem because we also mount nfs shares where users read and write data. Is there a way to have the user in the container “jovyan” actually be the LDAP user that is authenticated, with its UID, GID and all the user groups?

Any help is greatly appreciated

1 Like

If your image is based on GitHub - jupyter/docker-stacks: Ready-to-run Docker images containing Jupyter applications you can start the container as root and modify the UID/GID/username at startup by setting environment variables:
Common Features — Docker Stacks documentation

You’ll need to modify your LDAPAuthenticator to set those variables, I’ve got an example of doing that for Z2JH (Kubernetes) here, but you should be able to copy the necessary parts to work with DockerSpawner: