Skip to content
Discussion options

You must be logged in to vote

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...

USER root
install any packages my user will need
USER <my non root user>

If packages are needed at runtime, users can usually perform things like !pip install --user xxx from a notebook cell, etc., but baking the necessary packages into the image is usually…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rgbkrk
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants
Converted from issue

This discussion was converted from issue #5034 on May 24, 2026 12:54.