浏览代码

Update the option 'network' for docker build

Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
(cherry picked from commit cd317282c9b7d4dc68dce8df1d2f84e7a5654e72)
Signed-off-by: Victor Vieux <vieux@docker.com>
yuexiao-wang 8 年之前
父节点
当前提交
54e52b97f4
共有 3 个文件被更改,包括 7 次插入6 次删除
  1. 1 1
      cli/command/image/build.go
  2. 2 3
      docs/reference/commandline/build.md
  3. 4 2
      man/docker-build.1.md

+ 1 - 1
cli/command/image/build.go

@@ -107,7 +107,7 @@ func NewBuildCommand(dockerCli *command.DockerCli) *cobra.Command {
 	flags.StringSliceVar(&options.cacheFrom, "cache-from", []string{}, "Images to consider as cache sources")
 	flags.BoolVar(&options.compress, "compress", false, "Compress the build context using gzip")
 	flags.StringSliceVar(&options.securityOpt, "security-opt", []string{}, "Security options")
-	flags.StringVar(&options.networkMode, "network", "default", "Connect a container to a network")
+	flags.StringVar(&options.networkMode, "network", "default", "Set the networking mode for the RUN instructions during build")
 
 	command.AddTrustedFlags(flags, true)
 

+ 2 - 3
docs/reference/commandline/build.md

@@ -38,8 +38,7 @@ Options:
       --label value             Set metadata for an image (default [])
   -m, --memory string           Memory limit
       --memory-swap string      Swap limit equal to memory plus swap: '-1' to enable unlimited swap
-      --network string          Set the networking mode for the run commands
-                                during build.
+      --network string          Set the networking mode for the RUN instructions during build
                                 'bridge': use default Docker bridge
                                 'none': no networking
                                 'container:<name|id>': reuse another container's network stack
@@ -54,7 +53,7 @@ Options:
                                 The format is `<number><unit>`. `number` must be greater than `0`.
                                 Unit is optional and can be `b` (bytes), `k` (kilobytes), `m` (megabytes),
                                 or `g` (gigabytes). If you omit the unit, the system uses bytes.
-  --squash                      Squash newly built layers into a single new layer (**Experimental Only**) 
+      --squash                  Squash newly built layers into a single new layer (**Experimental Only**)
   -t, --tag value               Name and optionally a tag in the 'name:tag' format (default [])
       --ulimit value            Ulimit options (default [])
 ```

+ 4 - 2
man/docker-build.1.md

@@ -2,7 +2,7 @@
 % Docker Community
 % JUNE 2014
 # NAME
-docker-build - Build a new image from the source code at PATH
+docker-build - Build an image from a Dockerfile
 
 # SYNOPSIS
 **docker build**
@@ -130,7 +130,9 @@ set as the **URL**, the repository is cloned locally and then sent as the contex
 unit, `b` is used. Set LIMIT to `-1` to enable unlimited swap.
 
 **--network**=*NETWORK*
-  
+  Set the networking mode for the RUN instructions during build. Supported standard
+  values are: `bridge`, `host`, `none` and `container:<name|id>`. Any other value
+  is taken as a custom network's name or ID which this container should connect to.
 
 **--shm-size**=*SHM-SIZE*
   Size of `/dev/shm`. The format is `<number><unit>`. `number` must be greater than `0`.