From e5131e98edbe74fb652c2a19e285516451ba8155 Mon Sep 17 00:00:00 2001 From: WojtekMac Date: Wed, 14 Aug 2019 15:30:38 +0200 Subject: [PATCH] 2030 fixed link when bridge stated Signed-off-by: Wojciech Kosowicz --- cli/command/container/opts.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/command/container/opts.go b/cli/command/container/opts.go index 19a2d158cc..f5879a92e5 100644 --- a/cli/command/container/opts.go +++ b/cli/command/container/opts.go @@ -763,8 +763,9 @@ func parseNetworkAttachmentOpt(ep opts.NetworkAttachmentOpts) (*networktypes.End if len(ep.Aliases) > 0 { return nil, errors.New("network-scoped aliases are only supported for user-defined networks") } - if len(ep.Links) > 0 { - return nil, errors.New("links are only supported for user-defined networks") + if len(ep.Links) > 0 && + !container.NetworkMode(ep.Target).IsBridge() { + return nil, errors.New("links are only supported for user-defined networks and bridge network") } }