mirror of
https://github.com/docker/cli.git
synced 2026-10-09 23:45:39 -04:00
Merge pull request #23415 from aboch/ll
Allow user to specify container's link-local addresses Upstream-commit: c97fdbe3c5954b2685a8b140f595f06b09191956 Component: engine
This commit is contained in:
@@ -12,12 +12,13 @@ import (
|
||||
)
|
||||
|
||||
type connectOptions struct {
|
||||
network string
|
||||
container string
|
||||
ipaddress string
|
||||
ipv6address string
|
||||
links opts.ListOpts
|
||||
aliases []string
|
||||
network string
|
||||
container string
|
||||
ipaddress string
|
||||
ipv6address string
|
||||
links opts.ListOpts
|
||||
aliases []string
|
||||
linklocalips []string
|
||||
}
|
||||
|
||||
func newConnectCommand(dockerCli *client.DockerCli) *cobra.Command {
|
||||
@@ -41,6 +42,7 @@ func newConnectCommand(dockerCli *client.DockerCli) *cobra.Command {
|
||||
flags.StringVar(&opts.ipv6address, "ip6", "", "IPv6 Address")
|
||||
flags.Var(&opts.links, "link", "Add link to another container")
|
||||
flags.StringSliceVar(&opts.aliases, "alias", []string{}, "Add network-scoped alias for the container")
|
||||
flags.StringSliceVar(&opts.linklocalips, "link-local-ip", []string{}, "Add a link-local address for the container")
|
||||
|
||||
return cmd
|
||||
}
|
||||
@@ -50,8 +52,9 @@ func runConnect(dockerCli *client.DockerCli, opts connectOptions) error {
|
||||
|
||||
epConfig := &network.EndpointSettings{
|
||||
IPAMConfig: &network.EndpointIPAMConfig{
|
||||
IPv4Address: opts.ipaddress,
|
||||
IPv6Address: opts.ipv6address,
|
||||
IPv4Address: opts.ipaddress,
|
||||
IPv6Address: opts.ipv6address,
|
||||
LinkLocalIPs: opts.linklocalips,
|
||||
},
|
||||
Links: opts.links.GetAll(),
|
||||
Aliases: opts.aliases,
|
||||
|
||||
Reference in New Issue
Block a user