Open grooverdan opened 10 months ago
YOu can modify containers.conf to not set it.
Ack like #345
Yes except set it to default systctls to []
@giuseppe PTAL
you can also override it with --sysctl
, in your case it will be: --sysctl="net.ipv4.ping_group_range=999 999"
also keep in mind that running without root is not generally supported, there is some code in crun to allow it, but for example it fails with runc:
$ podman --runtime crun run --sysctl="net.ipv4.ping_group_range=999 999" --uidmap=999:0 --user 999:999 --rm busybox echo hi
hi
$ podman --runtime runc run --sysctl="net.ipv4.ping_group_range=999 999" --uidmap=999:0 --user 999:999 --rm busybox echo hi
Error: OCI runtime error: runc: runc create failed: User namespaces enabled, but no user mapping found.
Just clarifying "Can we just ignore this?" I meant treat a write
on /proc/sys/net/ipv4/ping_group_range
returning EINVAL
as non-fatal error/warning/notice. Are the sysctls set by this necessary for any part of podman operations?
the OCI runtime sets it, so it is out of our control. We'd need to extend the OCI runtime specs to support "optional" sysctls.
It would be easier to teach Podman not to set it if there is no root user mapped, or even better, to support some templating mechanism like --sysctl="net.ipv4.ping_group_range=$FIRST_UID $NUMBER_UIDS". However, this seems a bit overkill for something that only affects ping_group_range when running without root in the user namespace.
You can tall Podman to not set sysctls in this situation or modify containers.conf to not set it. This sysctl is just allowing the root procesess within the container to ping without requiring CAP_NET_RAW.
From strace:
Can we just ignore this?