Browse code

Update the option 'network' for docker build

Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>

yuexiao-wang authored on 2016/12/10 00:15:26
Showing 3 changed files
... ...
@@ -107,7 +107,7 @@ func NewBuildCommand(dockerCli *command.DockerCli) *cobra.Command {
107 107
 	flags.StringSliceVar(&options.cacheFrom, "cache-from", []string{}, "Images to consider as cache sources")
108 108
 	flags.BoolVar(&options.compress, "compress", false, "Compress the build context using gzip")
109 109
 	flags.StringSliceVar(&options.securityOpt, "security-opt", []string{}, "Security options")
110
-	flags.StringVar(&options.networkMode, "network", "default", "Connect a container to a network")
110
+	flags.StringVar(&options.networkMode, "network", "default", "Set the networking mode for the RUN instructions during build")
111 111
 
112 112
 	command.AddTrustedFlags(flags, true)
113 113
 
... ...
@@ -38,8 +38,7 @@ Options:
38 38
       --label value             Set metadata for an image (default [])
39 39
   -m, --memory string           Memory limit
40 40
       --memory-swap string      Swap limit equal to memory plus swap: '-1' to enable unlimited swap
41
-      --network string          Set the networking mode for the run commands
42
-                                during build.
41
+      --network string          Set the networking mode for the RUN instructions during build
43 42
                                 'bridge': use default Docker bridge
44 43
                                 'none': no networking
45 44
                                 'container:<name|id>': reuse another container's network stack
... ...
@@ -54,7 +53,7 @@ Options:
54 54
                                 The format is `<number><unit>`. `number` must be greater than `0`.
55 55
                                 Unit is optional and can be `b` (bytes), `k` (kilobytes), `m` (megabytes),
56 56
                                 or `g` (gigabytes). If you omit the unit, the system uses bytes.
57
-  --squash                      Squash newly built layers into a single new layer (**Experimental Only**) 
57
+      --squash                  Squash newly built layers into a single new layer (**Experimental Only**)
58 58
   -t, --tag value               Name and optionally a tag in the 'name:tag' format (default [])
59 59
       --ulimit value            Ulimit options (default [])
60 60
 ```
... ...
@@ -2,7 +2,7 @@
2 2
 % Docker Community
3 3
 % JUNE 2014
4 4
 # NAME
5
-docker-build - Build a new image from the source code at PATH
5
+docker-build - Build an image from a Dockerfile
6 6
 
7 7
 # SYNOPSIS
8 8
 **docker build**
... ...
@@ -130,7 +130,9 @@ set as the **URL**, the repository is cloned locally and then sent as the contex
130 130
 unit, `b` is used. Set LIMIT to `-1` to enable unlimited swap.
131 131
 
132 132
 **--network**=*NETWORK*
133
-  
133
+  Set the networking mode for the RUN instructions during build. Supported standard
134
+  values are: `bridge`, `host`, `none` and `container:<name|id>`. Any other value
135
+  is taken as a custom network's name or ID which this container should connect to.
134 136
 
135 137
 **--shm-size**=*SHM-SIZE*
136 138
   Size of `/dev/shm`. The format is `<number><unit>`. `number` must be greater than `0`.