Browse code

Allow --net=none & -h

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)

Victor Vieux authored on 2014/06/12 05:54:40
Showing 1 changed files
... ...
@@ -18,7 +18,7 @@ var (
18 18
 	ErrInvalidWorkingDirectory  = fmt.Errorf("The working directory is invalid. It needs to be an absolute path.")
19 19
 	ErrConflictAttachDetach     = fmt.Errorf("Conflicting options: -a and -d")
20 20
 	ErrConflictDetachAutoRemove = fmt.Errorf("Conflicting options: --rm and -d")
21
-	ErrConflictNetworkHostname  = fmt.Errorf("Conflicting options: -h and --net")
21
+	ErrConflictNetworkHostname  = fmt.Errorf("Conflicting options: -h and the network mode (--net)")
22 22
 )
23 23
 
24 24
 //FIXME Only used in tests
... ...
@@ -104,7 +104,7 @@ func parseRun(cmd *flag.FlagSet, args []string, sysInfo *sysinfo.SysInfo) (*Conf
104 104
 		return nil, nil, cmd, ErrConflictDetachAutoRemove
105 105
 	}
106 106
 
107
-	if *flNetMode != "bridge" && *flHostname != "" {
107
+	if *flNetMode != "bridge" && *flNetMode != "none" && *flHostname != "" {
108 108
 		return nil, nil, cmd, ErrConflictNetworkHostname
109 109
 	}
110 110