Bug 1121100

Summary: allow docker run --net=none --hostname=....
Product: [Fedora] Fedora EPEL Reporter: Gilles Gouaillardet <gilles.gouaillardet>
Component: docker-ioAssignee: Lokesh Mandvekar <lsm5>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: el6CC: admiller, dwalsh, golang-updates, hushan.jia, jperrin, mattdm, mgoldman, s, vbatts
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-20 19:36:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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 :
https://github.com/ggouaillardet/docker/commit/f411f8bfc5d04aed6499dfc90e357c58713bc84d

could you please backport this fix to docker-io for epel-6 ?

Thanks and regards,

Gilles

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