浏览代码

enhancing set-macaddress docu

Signed-off-by: Malte Janduda <mail@janduda.net>
Malte Janduda 10 年之前
父节点
当前提交
971fc2253a

+ 1 - 1
docs/man/docker-run.1.md

@@ -192,7 +192,7 @@ and foreground Docker containers.
    Set the MAC address for the container's ethernet device:
    Set the MAC address for the container's ethernet device:
     --mac-address=12:34:56:78:9a:bc
     --mac-address=12:34:56:78:9a:bc
 
 
-Remember that the MAC address in an ethernet network must be unique.
+Remember that the MAC address in an Ethernet network must be unique.
 The IPv6 link-local address will be based on the device's MAC address
 The IPv6 link-local address will be based on the device's MAC address
 according to RFC4862.
 according to RFC4862.
 
 

+ 3 - 3
docs/sources/articles/networking.md

@@ -105,7 +105,7 @@ Finally, several networking options can only be provided when calling
     [How Docker networks a container](#container-networking)
     [How Docker networks a container](#container-networking)
 
 
  *  `--mac-address=MACADDRESS...` — see
  *  `--mac-address=MACADDRESS...` — see
-    [How docker networks a container](#container-networking)
+    [How Docker networks a container](#container-networking)
 
 
  *  `-p SPEC` or `--publish=SPEC` — see
  *  `-p SPEC` or `--publish=SPEC` — see
     [Binding container ports](#binding-ports)
     [Binding container ports](#binding-ports)
@@ -540,13 +540,13 @@ The steps with which Docker configures a container are:
     separate and unique network interface namespace, there are no
     separate and unique network interface namespace, there are no
     physical interfaces with which this name could collide.
     physical interfaces with which this name could collide.
 
 
-4.  Set the interface's mac address according to the `--mac-address`
+4.  Set the interface's MAC address according to the `--mac-address`
     parameter or generate a random one.
     parameter or generate a random one.
 
 
 5.  Give the container's `eth0` a new IP address from within the
 5.  Give the container's `eth0` a new IP address from within the
     bridge's range of network addresses, and set its default route to
     bridge's range of network addresses, and set its default route to
     the IP address that the Docker host owns on the bridge. If available
     the IP address that the Docker host owns on the bridge. If available
-    the IP address is generated from the MAC address. This prevents arp
+    the IP address is generated from the MAC address. This prevents ARP
     cache invalidation problems, when a new container comes up with an
     cache invalidation problems, when a new container comes up with an
     IP used in the past by another container with another MAC.
     IP used in the past by another container with another MAC.
 
 

+ 1 - 1
docs/sources/reference/api/docker_remote_api.md

@@ -54,7 +54,7 @@ total memory available (`MemTotal`).
 
 
 `POST /containers/create`
 `POST /containers/create`
 **New!**
 **New!**
-You can define the container's MAC address by providing a MacAddress key-value pair.
+You can set the new container's MAC address explicitly.
 
 
 ## v1.15
 ## v1.15
 
 

+ 4 - 4
docs/sources/reference/run.md

@@ -140,7 +140,7 @@ example, `docker run ubuntu:14.04`.
                                   'container:<name|id>': reuses another container network stack
                                   'container:<name|id>': reuses another container network stack
                                   'host': use the host network stack inside the container
                                   'host': use the host network stack inside the container
     --add-host=""    : Add a line to /etc/hosts (host:IP)
     --add-host=""    : Add a line to /etc/hosts (host:IP)
-    --mac-address="" : Sets the container's ethernet device's mac address
+    --mac-address="" : Sets the container's ethernet device's MAC address
 
 
 By default, all containers have networking enabled and they can make any
 By default, all containers have networking enabled and they can make any
 outgoing connections. The operator can completely disable networking
 outgoing connections. The operator can completely disable networking
@@ -151,9 +151,9 @@ networking. In cases like this, you would perform I/O through files or
 Your container will use the same DNS servers as the host by default, but
 Your container will use the same DNS servers as the host by default, but
 you can override this with `--dns`.
 you can override this with `--dns`.
 
 
-By default a random mac is generated. You can set the container's mac address
-explicitly by providing a mac via the `--mac-address` parameter (format:
-12:34:56:78:9a:bc).
+By default a random MAC is generated. You can set the container's MAC address
+explicitly by providing a MAC via the `--mac-address` parameter (format:
+`12:34:56:78:9a:bc`).
 
 
 Supported networking modes are:
 Supported networking modes are:
 
 

+ 4 - 4
integration-cli/docker_cli_run_test.go

@@ -2027,11 +2027,11 @@ func TestRunSetMacAddress(t *testing.T) {
 	}
 	}
 	actualMac := strings.TrimSpace(out)
 	actualMac := strings.TrimSpace(out)
 	if actualMac != mac {
 	if actualMac != mac {
-		t.Fatalf("Set Mac Address with --mac-address failed. The container has an incorrect MAC address: %q, expected: %q", actualMac, mac)
+		t.Fatalf("Set MAC address with --mac-address failed. The container has an incorrect MAC address: %q, expected: %q", actualMac, mac)
 	}
 	}
 
 
 	deleteAllContainers()
 	deleteAllContainers()
-	logDone("run - setting Mac Address with --mac-address")
+	logDone("run - setting MAC address with --mac-address")
 }
 }
 
 
 func TestRunInspectMacAddress(t *testing.T) {
 func TestRunInspectMacAddress(t *testing.T) {
@@ -2047,10 +2047,10 @@ func TestRunInspectMacAddress(t *testing.T) {
 		t.Fatal(err)
 		t.Fatal(err)
 	}
 	}
 	if inspectedMac != mac {
 	if inspectedMac != mac {
-		t.Fatalf("Inspecting Mac Address with failed. docker inspect shows incorrect MacAddress: %q, actual Mac: %q", inspectedMac, mac)
+		t.Fatalf("docker inspect outputs wrong MAC address: %q, should be: %q", inspectedMac, mac)
 	}
 	}
 	deleteAllContainers()
 	deleteAllContainers()
-	logDone("run - inspecting Mac Address")
+	logDone("run - inspecting MAC address")
 }
 }
 
 
 func TestRunDeallocatePortOnMissingIptablesRule(t *testing.T) {
 func TestRunDeallocatePortOnMissingIptablesRule(t *testing.T) {

+ 1 - 1
runconfig/parse.go

@@ -59,7 +59,7 @@ func Parse(cmd *flag.FlagSet, args []string, sysInfo *sysinfo.SysInfo) (*Config,
 		flCpuShares       = cmd.Int64([]string{"c", "-cpu-shares"}, 0, "CPU shares (relative weight)")
 		flCpuShares       = cmd.Int64([]string{"c", "-cpu-shares"}, 0, "CPU shares (relative weight)")
 		flCpuset          = cmd.String([]string{"-cpuset"}, "", "CPUs in which to allow execution (0-3, 0,1)")
 		flCpuset          = cmd.String([]string{"-cpuset"}, "", "CPUs in which to allow execution (0-3, 0,1)")
 		flNetMode         = cmd.String([]string{"-net"}, "bridge", "Set the Network mode for the container\n'bridge': creates a new network stack for the container on the docker bridge\n'none': no networking for this container\n'container:<name|id>': reuses another container network stack\n'host': use the host network stack inside the container.  Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure.")
 		flNetMode         = cmd.String([]string{"-net"}, "bridge", "Set the Network mode for the container\n'bridge': creates a new network stack for the container on the docker bridge\n'none': no networking for this container\n'container:<name|id>': reuses another container network stack\n'host': use the host network stack inside the container.  Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure.")
-		flMacAddress      = cmd.String([]string{"-mac-address"}, "", "Container MAC address (ex: 92:d0:c6:0a:29:33)")
+		flMacAddress      = cmd.String([]string{"-mac-address"}, "", "Container MAC address (e.g. 92:d0:c6:0a:29:33)")
 		flRestartPolicy   = cmd.String([]string{"-restart"}, "", "Restart policy to apply when a container exits (no, on-failure[:max-retry], always)")
 		flRestartPolicy   = cmd.String([]string{"-restart"}, "", "Restart policy to apply when a container exits (no, on-failure[:max-retry], always)")
 	)
 	)