Skip to content
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

The home dir should be '/root', not '/home/root', when starting the container and set the env 'NB_USER' to 'root'. #2042

Closed
1 task done
orange-guo opened this issue Nov 24, 2023 · 2 comments · Fixed by #2079
Labels
type:Bug A problem with the definition of one of the docker images maintained here

Comments

@orange-guo
Copy link

What docker image(s) are you using?

base-notebook

Host OS system

ubuntu 23.10

Host architecture

x86_64

What Docker command are you running?

docker run --rm --user root -p 8888:8888 -e JUPYTER_TOKEN=123 -e NB_UID=0 -e NB_GID=0 -e NB_USER=root jupyter/base-notebook:notebook-7.0.2 /usr/local/bin/start-notebook.sh --allow-root

How to Reproduce the problem?

  1. Run the following command
docker run --rm --user root -p 8888:8888 -e JUPYTER_TOKEN=123 -e NB_UID=0 -e NB_GID=0 -e NB_USER=root jupyter/base-notebook:notebook-7.0.2 /usr/local/bin/start-notebook.sh --allow-root
  1. After the container starts, the logs contain the following information:
Entered start.sh with args: jupyter lab --allow-root
Running hooks in: /usr/local/bin/start-notebook.d as uid: 0 gid: 0
Done running hooks in: /usr/local/bin/start-notebook.d
Updated the jovyan user:
- username: jovyan       -> root
- home dir: /home/jovyan -> /home/root
Attempting to copy /home/jovyan to /home/root...
Success!
Changing working directory to /home/root/
Running hooks in: /usr/local/bin/before-notebook.d as uid: 0 gid: 0
Done running hooks in: /usr/local/bin/before-notebook.d
Running as root: jupyter lab --allow-root

The logs indicate that the home directory has been set to '/home/root' instead of '/root'.

Command output

Entered start.sh with args: jupyter lab --allow-root
Running hooks in: /usr/local/bin/start-notebook.d as uid: 0 gid: 0
Done running hooks in: /usr/local/bin/start-notebook.d
Updated the jovyan user:
- username: jovyan       -> root
- home dir: /home/jovyan -> /home/root
Attempting to copy /home/jovyan to /home/root...
Success!
Changing working directory to /home/root/
Running hooks in: /usr/local/bin/before-notebook.d as uid: 0 gid: 0
Done running hooks in: /usr/local/bin/before-notebook.d
Running as root: jupyter lab --allow-root
`

Expected behavior

The home dir should be '/root', not '/home/root', when starting the container and set the env 'NB_USER' to 'root'.

Actual behavior

When setting the NB_USER as 'root', the home dir should be '/root'.

Anything else?

No response

Latest Docker version

  • I've updated my Docker version to the latest available, and the issue persists
@orange-guo orange-guo added the type:Bug A problem with the definition of one of the docker images maintained here label Nov 24, 2023
@benz0li
Copy link
Contributor

benz0li commented Nov 24, 2023

@orange-guo See #2039 for an ongoing discussion.

@benz0li
Copy link
Contributor

benz0li commented Nov 24, 2023

IMHO we do not want to use (and touch) the original /root directory.

For my explanation, see #2039 (comment) ff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:Bug A problem with the definition of one of the docker images maintained here
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants