-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to add groups (such as --group-add) when using NB_USER, NB_UID, NB_GID parameters #2137
Comments
We have startup hooks, where you can run anything inside the container, does this help? https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html#startup-hooks |
Ho yes it works perfectly thank you ! Here is an example of adding the "docker" group to the user. I do this to be able to run docker inside docker: To add a script in the 1. Create a Custom DockerfileThis Dockerfile will add your script to the # Use the official Jupyter Notebook base image
FROM jupyter/base-notebook:latest
# Copy hook script that adds the docker group to the NB_USER
USER root
COPY add-docker-group.sh /usr/local/bin/before-notebook.d/add-docker-group.sh
# Ensure the script is executable
RUN chmod +x /usr/local/bin/before-notebook.d/add-docker-group.sh 2. Create the
|
I’m glad our startup hooks worked for you. I don’t think your use case should be implemented as part of |
Yes thank you for pointing out the startup hooks solution ! I'll try to contribute to custom recipes ! |
@tom725 With b-data's/my JupyterLab docker stacks1, I prefer using a
NB_USER=benz0li
name: jupyter
services:
docker:
image: docker:dind
hostname: docker
restart: always
networks:
- jupyter
volumes:
- docker-certs:/var/tmp/docker/certs
- docker-data:/var/lib/docker
- ./home:/home
environment:
- HOME=/home/${NB_USER}
- DOCKER_TLS_CERTDIR=/var/tmp/docker/certs
privileged: true
jupyterlab:
image: glcr.b-data.ch/jupyterlab/python/scipy:latest-docker
restart: always
ports:
- "127.0.0.1:8888:8888"
networks:
- jupyter
volumes:
- docker-certs:/var/tmp/docker/certs
- ./home:/home
environment:
- DOCKER_HOST=tcp://docker:2376
- DOCKER_CERT_PATH=/var/tmp/docker/certs/client
- DOCKER_TLS_VERIFY=1
- NB_USER=${NB_USER}
- NOTEBOOK_ARGS=--LabApp.token=''
user: root
networks:
jupyter:
external: true
volumes:
docker-certs:
docker-data: Then, execute docker network create jupyter
docker compose up -d and access on http://127.0.0.1:8888. Footnotes
|
What docker image(s) is this feature applicable to?
base-notebook
What change(s) are you proposing?
Hello !
I hope this is the right place for this message
I'm running a jupyter docker with parameters NB_USER, NB_UID, NB_GID which is very usefull.
I would like to add a group to the user in the running container, however the docker run option "--group-add" does not work in this context.
Unless I misunderstood something, I would suggest to modify the "starts.sh" script so that multiple groups can be added to the current user. I don't know exactly how to modify this script but it would imply adding a new user parameter.
How does this affect the user?
This feature will give the possibility to add multiple groups to the user
Anything else?
No response
The text was updated successfully, but these errors were encountered: