mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
returns an error when using -h and --net
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
This commit is contained in:
parent
29f1efc940
commit
2899195540
1 changed files with 5 additions and 0 deletions
|
@ -17,6 +17,7 @@ var (
|
|||
ErrInvalidWorkingDirectory = fmt.Errorf("The working directory is invalid. It needs to be an absolute path.")
|
||||
ErrConflictAttachDetach = fmt.Errorf("Conflicting options: -a and -d")
|
||||
ErrConflictDetachAutoRemove = fmt.Errorf("Conflicting options: --rm and -d")
|
||||
ErrConflictNetworkHostname = fmt.Errorf("Conflicting options: -h and --net")
|
||||
)
|
||||
|
||||
//FIXME Only used in tests
|
||||
|
@ -101,6 +102,10 @@ func parseRun(cmd *flag.FlagSet, args []string, sysInfo *sysinfo.SysInfo) (*Conf
|
|||
return nil, nil, cmd, ErrConflictDetachAutoRemove
|
||||
}
|
||||
|
||||
if *flNetMode != "bridge" && *flHostname != "" {
|
||||
return nil, nil, cmd, ErrConflictNetworkHostname
|
||||
}
|
||||
|
||||
// If neither -d or -a are set, attach to everything by default
|
||||
if flAttach.Len() == 0 && !*flDetach {
|
||||
if !*flDetach {
|
||||
|
|
Loading…
Reference in a new issue