Use repo2docker container with singularoty

Hello,
We are trying to use a container made with repo2Docker on our HPC system, but we are using singularity with our /home mounted automatically. We can’t access /home/jovyan when we launch our container.

Is there procedure to use repo2Docker with singularity ?

Thank you,

repo2docker has a --user-id flag. If you set that to the owner of your mounted directory does it work?

This option changes the user name, but it is still not recognized by our file system and belongs to root.

github action :

    - name: update jupyter dependencies with repo2docker
      uses: jupyterhub/repo2docker-action@master
      with:
        DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
        DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
        NOTEBOOK_USER: roussman

singularity creation :

singularity shell --env JUPYTER_ENABLE_LAB=yes        docker://roussman/pytudes
Singularity> ls -ls /home
total 1
0 drwxr-xr-x. 3 roussman ipadefaultgp 60 Mar 14 10:16 qt
1 drwxr-x---. 2 root     root         66 Mar 14 09:51 roussman

The username argument is separate from the user ID. You didn’t mention you were using the GitHub action- it doesn’t support the user-id argument, instead you could run repo2docker directly in your GitHub workflow.

I’ve tried setting the user_id as my own, but I still have the same problem. Another problem is that this container is to be used by several users, so I can’t set it for my account alone. I managed to access the repository inside the container by adding a chmod in the container creation. Can I add this option and make a merge request in the repo2docker project?

I’m surprised setting the user-id didn’t work. Can you share the full repo2docker command line and an example repository that you’re having problems with? Which version of repo2docker are you using?

1 Like

I have a fork of the main branch. I didn’t use the command, since I was already testing some modifications, I hard-coded my user_id app.py (l777).

I solved my issue by adding this chmod in the appendix option. Thank you for your help !

1 Like