Skip to content

Why does rootless nerdctl run two times of main()? #2013

Answered by AkihiroSuda
ningziwen asked this question in Q&A
Discussion options

You must be logged in to vote

To enter the namespaces.

nerdctl/cmd/nerdctl/main.go

Lines 229 to 232 in bb7bba5

if appNeedsRootlessParentMain(cmd, args) {
// reexec /proc/self/exe with `nsenter` into RootlessKit namespaces
return rootlessutil.ParentMain()
}

(Without this, nsentering to userns isn't possible with Go AFAICS due to threading)

Replies: 2 comments 4 replies

Comment options

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

You must be logged in to vote
4 replies
@AkihiroSuda
Comment options

@fahedouch
Comment options

@ningziwen
Comment options

@AkihiroSuda
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area/rootless Rootless mode
3 participants