How to start container as non-root with entrypoint /sbin/init #14986
imperialguy
started this conversation in
General
Replies: 2 comments 5 replies
-
Any ideas on this one? |
Beta Was this translation helpful? Give feedback.
0 replies
-
I don't think this can be done. Default user tells the OCI containers to run the PID 1 as that user. So you are attempting to run systemd as non root. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have an image that I configured with:
entrypoint
as/sbin/init
If I run it as it is and login to the container, I notice that
systemd
is not running:Is there a way to start a container as non-root but also kick-off the
systemd
process?Currently the only way to do that is by leaving the default user as
root
or explicitly starting a non-root container asroot
, for e.g. like this:Basically, I want to set the default container user as non-root, but I also want the container to start in
systemd
mode. Any ideas/suggestions would be greatly appreciated.The alternative I am thinking about is to install
sudo
inside container and give the rootless user restrictive permissions to runsystemd
.Beta Was this translation helpful? Give feedback.
All reactions