diff --git a/cli/command/container/opts.go b/cli/command/container/opts.go index 19a2d158cca9..f5879a92e591 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") } }