You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a plan to support a non-root user inside base?
Reacted by Sebastian Stammler, Sebastian Davids, Nabil Servais, Simon Niedermayr, Marius Grigoriu, Paul Morie, suiiii, Tomasz Klosinski and Eugen Mayer
I believe it is already supported in the sense that you can run a Distroless-based image as some other user. Is your question that the image should default to a non-root user? If yes, then which UID is safe on all systems?
I've seen user accounts in the 5000s for GKE/COS. Other systems and their admins may decide on other UID ranges. Seems like a base image should be able to operate under any UID according to the sys admin's preferences.
I don't think we'll be changing the default of this from 0. Most other official images use 0, and it's easily overrideable in the runtime or in a base image.
I had a similar argument, but @HazCod's argument was that those images keep the root mainly due to the existence of a package manager, which doesn't apply to Distroless.
In any case, if we do this, not sure if nobody would be a good fit, considering its nature. (Also nobody's home would be set to /nonexistent), so we may need to add a proper new user?
My only argument against using nobody is that the container user should have a home directory so that there's a place for dotfiles (e.g., ~/.docker/config.json) to be installed.
I second @mattmoor's statements. Specific use case for me is publishing knative images that don't take root privs. Currently it appears that ko will have to inherit this from the base image.
Reacted by Nicolas Henneaux, bademux, Jannik Hollenbach, Johan Dewe, Josef Andersson, Sylvain Muller, Carl Winbäck, Peter Nann, Kevin Ingelman, usagiga and 1 more
@loosebazooka all the images have the nonroot user and group. By default, all the images without the tag :nonroot run as root as usual. It is just that only the images with the :nonroot tag run as the nonroot user by default. And so far, only a small number of repositories introduced the :nonroot tag.
Reacted by Appu, Benjamin Eckstein, Serge Hartmann, Tomasz Klosinski, Malathi T and Peter Nann
Activity
mariusgrigoriu commentedon Sep 14, 2018
I believe it is already supported in the sense that you can run a Distroless-based image as some other user. Is your question that the image should default to a non-root user? If yes, then which UID is safe on all systems?
vic3lord commentedon Sep 16, 2018
@mariusgrigoriu yes, I meant as a default value. I think something above 1000 is safe, unless there's something I am missing.
mariusgrigoriu commentedon Sep 17, 2018
I've seen user accounts in the 5000s for GKE/COS. Other systems and their admins may decide on other UID ranges. Seems like a base image should be able to operate under any UID according to the sys admin's preferences.
dlorenc commentedon Sep 17, 2018
I don't think we'll be changing the default of this from 0. Most other official images use 0, and it's easily overrideable in the runtime or in a base image.
chanseokoh commentedon Mar 27, 2019
Opening for discussion from #306.
I had a similar argument, but @HazCod's argument was that those images keep the root mainly due to the existence of a package manager, which doesn't apply to Distroless.
In any case, if we do this, not sure if nobody would be a good fit, considering its nature. (Also nobody's home would be set to /nonexistent), so we may need to add a proper new user?
briandealwis commentedon Mar 27, 2019
I'll add that we recommend avoiding running as root in our Best Practices for Operating Containers.
My only argument against using
nobodyis that the container user should have a home directory so that there's a place for dotfiles (e.g.,~/.docker/config.json) to be installed.mattmoor commentedon Apr 23, 2019
I'd love to see us at a minimum publish
:nonrootimages, which consuming projects (e.g. ko, jib, bazel) can opt over to case-by-case.cc @jonjohnsonjr Can you TAL?
jonjohnsonjr commentedon Apr 26, 2019
The disastrous python2 -> python3 migration may be our industry's greatest blunder.
pmorie commentedon May 23, 2019
I second @mattmoor's statements. Specific use case for me is publishing knative images that don't take root privs. Currently it appears that
kowill have to inherit this from the base image.chanseokoh commentedon Jun 19, 2019
FTR, now the images have a user and a group all named "nonroot".
/etc/passwdcontent:/etc/groupcontent:loosebazooka commentedon Jun 19, 2019
This doesn't apply to the language builds yet, does it?
chanseokoh commentedon Jun 19, 2019
@loosebazooka all the images have the
nonrootuser and group. By default, all the images without the tag:nonrootrun as root as usual. It is just that only the images with the:nonroottag run as thenonrootuser by default. And so far, only a small number of repositories introduced the:nonroottag.