summaryrefslogtreecommitdiff
path: root/runconfig/opts
diff options
context:
space:
mode:
authorArnaud Porterie (icecrime) <arnaud.porterie@docker.com>2016-06-06 16:33:00 -0700
committerArnaud Porterie (icecrime) <arnaud.porterie@docker.com>2016-07-12 13:01:35 -0700
commitc0c7d5e71586ec8e4d54aef9e061f061e9223cc4 (patch)
tree7e3e45fc2f3e91b5c5ee7d779734f6f36857c84b /runconfig/opts
parent5b21c8a40823edf82b3b3f22c559c524a49d25a9 (diff)
downloaddocker-c0c7d5e71586ec8e4d54aef9e061f061e9223cc4.tar.gz
Rename `--net` to `--network`
Add a `--network` flag which replaces `--net` without deprecating it yet. The `--net` flag remains hidden and supported. Add a `--network-alias` flag which replaces `--net-alias` without deprecating it yet. The `--net-alias` flag remains hidden and supported. Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
Diffstat (limited to 'runconfig/opts')
-rw-r--r--runconfig/opts/parse.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/runconfig/opts/parse.go b/runconfig/opts/parse.go
index 27ccf93561..e6409cc4d5 100644
--- a/runconfig/opts/parse.go
+++ b/runconfig/opts/parse.go
@@ -182,10 +182,16 @@ func AddFlags(flags *pflag.FlagSet) *ContainerOptions {
flags.Var(&copts.flLinks, "link", "Add link to another container")
flags.Var(&copts.flLinkLocalIPs, "link-local-ip", "Container IPv4/IPv6 link-local addresses")
flags.StringVar(&copts.flMacAddress, "mac-address", "", "Container MAC address (e.g. 92:d0:c6:0a:29:33)")
- flags.StringVar(&copts.flNetMode, "net", "default", "Connect a container to a network")
- flags.Var(&copts.flAliases, "net-alias", "Add network-scoped alias for the container")
flags.VarP(&copts.flPublish, "publish", "p", "Publish a container's port(s) to the host")
flags.BoolVarP(&copts.flPublishAll, "publish-all", "P", false, "Publish all exposed ports to random ports")
+ // We allow for both "--net" and "--network", although the latter is the recommended way.
+ flags.StringVar(&copts.flNetMode, "net", "default", "Connect a container to a network")
+ flags.StringVar(&copts.flNetMode, "network", "default", "Connect a container to a network")
+ flags.MarkHidden("net")
+ // We allow for both "--net-alias" and "--network-alias", although the latter is the recommended way.
+ flags.Var(&copts.flAliases, "net-alias", "Add network-scoped alias for the container")
+ flags.Var(&copts.flAliases, "network-alias", "Add network-scoped alias for the container")
+ flags.MarkHidden("net-alias")
// Logging and storage
flags.StringVar(&copts.flLoggingDriver, "log-driver", "", "Logging driver for container")