-
|
Hello runc developers, I'm learning how namespace works, this program requires /proc/sys/net/ipv4/ping_group_range to be valid to work properly, docker run \
--rm \
-it \
--network=none \
-u $(id -u):$(id -g) \
--privileged
-v /work_dir:/mnt bashI have if run docker as root docker run \
--rm \
-it \
--network=none \
--privileged
-v /work_dir:/mnt bashI have seems that docker has a separate network namespace, and my test program can work properly but under bazel linux-sandbox (also as normal user) I have or if run bazel linux-sandbox with fakeroot (only map inner user to 0) I have seems I have some invalid group id inside bazel linux-sandbox. I found someone said is it true? does runc do something special to make it work inside new namespace ? then I tried to modify bazel source code to write uid_map/gid_map as docker to or they both failed , no matter if I run bazel linux-sandbox as normal user or root.seems it can only write the range as 1. my question is , how runc deal with the network namespace, and the user map during initialize, to make them work ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The simplest solution is probably to just run (Also, I don't know what |
Beta Was this translation helpful? Give feedback.
docker runis actually spawning a container without user namespaces (docker runis run as an unprivileged user but the Docker daemon runs as root). Docker also sets up the network namespace to allow for unprivileged pings automatically./proc/self/uid_mapor/proc/self/gid_mapafter they have been set, and in this case the container process is unprivileged so it wouldn't be able to change the maps to anything else even if it wanted to.The simplest solution is probably to just run
linux-sandboxas root. User namespaces result in more secure …