Currently, docker run will fail if both --net=none and --hostname=... options are used.
This has been fixed in the docker git repository :
could you please backport this fix to docker-io for epel-6 ?
Thanks and regards,
This will be available once version v1.1.1 (or later) will be packaged for EPEL6. Or is there a plan to backport it? Lokesh?
Bug 1118603 does track some new dependencies which are needed for 1.1.1 which will need to get completed.
Hi Marek and all,
the latest CentOS 7 (and hence RHEL 7 i guess) also does not support both --net=none and --hostname=...
as a side note, and thought i was able to rebuild docker on CentOS 7, i initially failed rebuilding docker-io on CentOS 6 :
# rpmbuild -ba SPECS/docker-io.spec
error: Failed build dependencies:
golang(github.com/gorilla/mux) >= 0-0.13 is needed by docker-io-1.0.0-7.el6.x86_64
golang(github.com/kr/pty) >= 0-0.19 is needed by docker-io-1.0.0-7.el6.x86_64
golang(github.com/coreos/go-systemd) >= 2-1 is needed by docker-io-1.0.0-7.el6.x86_64
golang(github.com/syndtr/gocapability/capability) >= 0-0.7 is needed by docker-io-1.0.0-7.el6.x86_64
if i rpmbuild --nodeps ..., docker fails to start a container
(error message is "Invalid argument")
if i update from the required packages from epel-testing repo, then it works fine.
i initially tried to workaround this issue by using --lxc-conf="lxc.utsname = ..." instead of --hostnane=... but the first option had no effect (e.g. the host name was automatically generated by docker)
one more note ...
after applying the patch, the /etc/hosts of the container is invalid :
the ip address of the host is a dynamic one (e.g. the one that would have been used without --net=none --lxc-conf= ...) instead of the one passed on the command line with --lxc-conf="lxc.network.ipv4 = a.b.c.d"
as a work around, i configured a dns and the container /etc/nsswitch.conf to use dns only
Gilles, could you check if docker 1.1.2 takes care of this bug?
docker 1.1.2 does take care of the initially reported bug
that being said, the /etc/hosts is incorrectly generated.
if run several times in a row
docker run ... grep myhostname /etc/hosts
then i always get a different result/ip which is different from the one i requested via --lxc-conf="lxc.network.ipv4=..."
Please open a bug for your second issue.
Fixed in docker-1.1.2