Bug 1121100 - allow docker run --net=none --hostname=....
Summary: allow docker run --net=none --hostname=....
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: docker-io
Version: el6
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Lokesh Mandvekar
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2014-07-18 11:05 UTC by Gilles Gouaillardet
Modified: 2014-11-20 19:36 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-11-20 19:36:52 UTC

Attachments (Terms of Use)

Description Gilles Gouaillardet 2014-07-18 11:05:21 UTC
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,


Comment 1 Marek Goldmann 2014-07-21 16:43:38 UTC
Hi Gilles,

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?

Comment 2 Lokesh Mandvekar 2014-07-21 16:52:25 UTC
Bug 1118603 does track some new dependencies which are needed for 1.1.1 which will need to get completed.

Vincent: ping

Comment 3 Gilles Gouaillardet 2014-07-22 06:01:39 UTC
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)

Comment 4 Gilles Gouaillardet 2014-07-23 08:02:29 UTC
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

Comment 5 Lokesh Mandvekar 2014-08-19 04:48:37 UTC
Gilles, could you check if docker 1.1.2 takes care of this bug?

Comment 6 Gilles Gouaillardet 2014-08-19 07:07:09 UTC
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=..."

Comment 7 Daniel Walsh 2014-11-20 19:36:52 UTC
Please open a bug for your second issue.

Fixed in docker-1.1.2

Note You need to log in before you can comment on or make changes to this bug.