Docker-stacks: Unable to use other users other than the default one

Created on 16 Apr 2018  路  5Comments  路  Source: jupyter/docker-stacks

Hi! Could you pls. help me?

I'm using the latest version of the base notebook in Ubuntu.
I want the current logged in user to have all permissions as the default user - joyvan. Also, the current user need to have the correct permissions on the mounted volume.

Issue:
When I use the below command, I get the notebook. The current user is joyvan (verified using whoami).

docker run -d -p 8888:8888 jupyter/base-notebook start-notebook.sh --NotebookApp.token=''
When I use the below command, I get connection timeout error and notebook does not launch.
Expected Result:
When -u (userid) and --group-add users are passed, the Jupyter Notebook must be launched and the current logged in user (not joyvan) must be the current user and must have access to the volume.
docker run -d -p 8888:8888 jupyter/base-notebook start-notebook.sh --NotebookApp.token='' --user id -u -- --group-add users

My questions are

  1. How do I pass a different user id and group id (other than joyvan) as parameter to the docker run as -user is not working?
  2. How to make sure the passed userid has all the right permissions to access the volume?
  3. Also, the current logged in user must be shown when I use 'whoami'.
    Could you pls. let me know whether there is an issue or additional steps that need to be performed?
    Appreciate any help!!

If you are reporting an issue with one of the existing images, please answer the questions below to help us troubleshoot the problem. Please be as thorough as possible.

What docker image you are using?

Example: jupyter/scipy-notebook

What complete docker command do you run to launch the container (omitting sensitive values)?

Example: docker run -it --rm -p 8889:8888 jupyter/all-spark-notebook:latest

What steps do you take once the container is running to reproduce the issue?

Example:

  1. Visit http://localhost:8889
  2. Start an R noteobok
  3. ...

What do you expect to happen?

Example: ggplot output appears in my notebook.

What actually happens?

Example: No output is visible in the notebook and the notebook server log contains messages about ...

Question

Most helpful comment

The documentation now covers changing the user ID, group ID, and username at container launch time.

I'm going to close this issue as answered. Please feel free to open a new one if you have further questions, or send pull requests if you'd like to help make the documentation clearer.

Where?

All 5 comments

The images support changing the jovyan user ID and group ID via environment variables documented in the READMEs (https://github.com/jupyter/docker-stacks/blob/master/base-notebook/README.md#docker-options). There is also support for changing the jovyan user name itself via the -e NB_USER=somename environment variable, but the documentation has not kept pace with all of the options. (We're working on a docs site in #517).

The documentation now covers changing the user ID, group ID, and username at container launch time.

I'm going to close this issue as answered. Please feel free to open a new one if you have further questions, or send pull requests if you'd like to help make the documentation clearer.

@parente I know this is closed and well documented. However, can you highlight any security risks of starting the container as --user root? What vulnerabilities are potentially exposed? Thanks for any information on this topic.

The documentation now covers changing the user ID, group ID, and username at container launch time.

I'm going to close this issue as answered. Please feel free to open a new one if you have further questions, or send pull requests if you'd like to help make the documentation clearer.

Where?

The documentation now covers changing the user ID, group ID, and username at container launch time.

Where?

This seems to be it.
https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html

Was this page helpful?
0 / 5 - 0 ratings