pivot_root succeeds if user namespace is not used, but fails with EINVAL (os error 22). Bind mounting the new_root to itself solves it. I think that's a hack used by go example as well. Maybe the CloneCb should include this logic?
Environment: Xenial 4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
pivot_rootsucceeds if user namespace is not used, but fails withEINVAL(os error 22). Bind mounting thenew_rootto itself solves it. I think that's a hack used bygoexample as well. Maybe theCloneCbshould include this logic?Environment: Xenial
4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux