any bad affects when starting notebook with root user rather than jovyan? #7932
-
|
hi, i found that jupyter notebook config with option '--allow-root' in Dockerfile, but the default user jovyan is in 'users' group without sudo. so i change user by 'USER root' for notebook user to run apt get or sth like that. Expecting a reply or pointing out my misunderstanding,XD |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Running a container as root is just bad practice and there are numerous blog posts stating why. While completely isolated containers will appear to work fine, you can get into issues when mounting host directories since they can now be manipulated as the root user. Network operations will also be performed as root, etc., etc. Folks typically add the necessary packages to their containers at build time via a sequence similar to this... If packages are needed at runtime, users can usually perform things like The |
Beta Was this translation helpful? Give feedback.
-
|
Truly appreciated for your detailed answer! |
Beta Was this translation helpful? Give feedback.
-
|
@SmartInWhut could this be closed? |
Beta Was this translation helpful? Give feedback.
Running a container as root is just bad practice and there are numerous blog posts stating why. While completely isolated containers will appear to work fine, you can get into issues when mounting host directories since they can now be manipulated as the root user. Network operations will also be performed as root, etc., etc.
Folks typically add the necessary packages to their containers at build time via a sequence similar to this...
If packages are needed at runtime, users can usually perform things like
!pip install --user xxxfrom a notebook cell, etc., but baking the necessary packages into the image is usually…