Add --link accept container ID
Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
parent
0da9540eda
commit
400d92871c
|
@ -752,10 +752,7 @@ func (daemon *Daemon) RegisterLinks(container *Container, hostConfig *runconfig.
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
child, err := daemon.GetByName(parts["name"])
|
child := daemon.Get(parts["name"])
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if child == nil {
|
if child == nil {
|
||||||
return fmt.Errorf("Could not get container for %s", parts["name"])
|
return fmt.Errorf("Could not get container for %s", parts["name"])
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ func Parse(cmd *flag.FlagSet, args []string) (*Config, *HostConfig, *flag.FlagSe
|
||||||
|
|
||||||
cmd.Var(&flAttach, []string{"a", "-attach"}, "Attach to STDIN, STDOUT or STDERR.")
|
cmd.Var(&flAttach, []string{"a", "-attach"}, "Attach to STDIN, STDOUT or STDERR.")
|
||||||
cmd.Var(&flVolumes, []string{"v", "-volume"}, "Bind mount a volume (e.g., from the host: -v /host:/container, from Docker: -v /container)")
|
cmd.Var(&flVolumes, []string{"v", "-volume"}, "Bind mount a volume (e.g., from the host: -v /host:/container, from Docker: -v /container)")
|
||||||
cmd.Var(&flLinks, []string{"#link", "-link"}, "Add link to another container in the form of name:alias")
|
cmd.Var(&flLinks, []string{"#link", "-link"}, "Add link to another container in the form of <name|id>:alias")
|
||||||
cmd.Var(&flDevices, []string{"-device"}, "Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm)")
|
cmd.Var(&flDevices, []string{"-device"}, "Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm)")
|
||||||
|
|
||||||
cmd.Var(&flEnv, []string{"e", "-env"}, "Set environment variables")
|
cmd.Var(&flEnv, []string{"e", "-env"}, "Set environment variables")
|
||||||
|
|
Loading…
Reference in New Issue