-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[FAST_BUILD] Add support for Docker/Podman in rootless mode #2039
Conversation
Due to the additional |
And yes, the IMHO we do not want to use (and touch) the original |
Added |
What's your thinking behind not touching
|
See docker-stacks/images/docker-stacks-foundation/start.sh Lines 84 to 85 in 406e397
But also with regard to #1478, which may be implemented in the future.
The
This PR is meant for one use case only: Starting the container with options @manics I do not understand exactly what you are trying to demonstrate. But regarding the container startup there is # Update the home directory if the desired user (NB_USER) is root and the
# desired user id (NB_UID) is 0 and the desired group id (NB_GID) is 0.
if [ "${NB_USER}" = "root" ] && [ "${NB_UID}" = "$(id -u "${NB_USER}")" ] && [ "${NB_GID}" = "$(id -g "${NB_USER}")" ]; then
sed -i "s|/root|/home/root|g" /etc/passwd
# Do not preserve ownership in rootless mode
CP_OPTS="-a --no-preserve=ownership"
fi in place. Footnotes |
The triplet Otherwise you run into
followed by docker-stacks/images/docker-stacks-foundation/start.sh Lines 77 to 78 in baa110d
--non-unique .
👉 You cannot remove the user the container is running with ( |
@manics may I ask you to review this, please? |
It looks like this solves one instance of the problem of running a rootless container without dealing with different subuids. I'm still not convinced changing root's home directory to Having said that there's actually two different issues being discussed here:
I think it'd be nice to solve the more general problem for rootless running and allow Edit: If root's home directory is automatically changed then I think this needs to be documented somewhere. |
I checked, and current images already run the command above and rename I also think having So, let's keep this option for now.
I do agree here, this is not obvious. If you document it, please also add If you can also add a test case, that the triplet in the issue runs without an error, that would be nice (I do not insist though). |
Merging this one. I will document the current behaviour in a separate PR. |
Describe your changes
Add support for Docker/Podman in rootless mode.
Enables the container to run as
root
user, e.g.FYI @anil-resero
Issue ticket if applicable
Fixes #2036
Checklist (especially for first-time contributors)