missing NIS domainname
We have had various complaints in Docker eg see https://github.com/docker/docker/issues/27067 that you cannot set the domainname, just the hostname. As runc has no way to set the domain name, we cannot easily implement this. Can we add a new optional field for domain name? It would exactly match hostname, except on Linux it would use the setdomainname(2) syscall not sethostname(2).
This is used by some applications eg NIS (where it originated as a field I believe).
Have not yet determined if Windows has a comparable field, it seems likely. Other Unixes certainly do.
Happy to add a patch (and in runc) if this is acceptable.
Heh, you beat me to this. :wink:
I reckon the config should look like:
{ "nis": { "hostname": "a", "domainname": "b.com" } }
Where you can replace "nis" with "uname" (or "uts") if more appropriate.
Actually I think this may be Linux specific, looking at FreeBSD https://www.freebsd.org/cgi/man.cgi?query=domainname&sektion=1&apropos=0&manpath=FreeBSD+10.3-RELEASE+and+Ports it is set in /etc/rc.conf not kernel mediated and read via sysctl so there would be nothing for runc to usefully do here.
We could shove it in config-linux then under nisdomainname. But maybe Solaris implements it?
yes I think that may be the best option.
It looks to me like Solaris is like FreeBSD, although I could not find a definitive answer. BSD says their version came from SunOS. It is not in Posix as part of uname.
Thinking about this more I think it's possible to just use kernel.domainname to set the domain name without needing any OCI support (especially because the idea would be to just make it Linux-specific anyway).
I've figured out this can be entirely done with opencontainers/runc#1827 and moby/moby#37302.
Completed in:
- https://github.com/opencontainers/runtime-spec/pull/1156