Browse code

enhancing set-macaddress docu

Signed-off-by: Malte Janduda <mail@janduda.net>

Malte Janduda authored on 2014/11/03 19:43:11
Showing 6 changed files
... ...
@@ -192,7 +192,7 @@ and foreground Docker containers.
192 192
    Set the MAC address for the container's ethernet device:
193 193
     --mac-address=12:34:56:78:9a:bc
194 194
 
195
-Remember that the MAC address in an ethernet network must be unique.
195
+Remember that the MAC address in an Ethernet network must be unique.
196 196
 The IPv6 link-local address will be based on the device's MAC address
197 197
 according to RFC4862.
198 198
 
... ...
@@ -105,7 +105,7 @@ Finally, several networking options can only be provided when calling
105 105
     [How Docker networks a container](#container-networking)
106 106
 
107 107
  *  `--mac-address=MACADDRESS...` — see
108
-    [How docker networks a container](#container-networking)
108
+    [How Docker networks a container](#container-networking)
109 109
 
110 110
  *  `-p SPEC` or `--publish=SPEC` — see
111 111
     [Binding container ports](#binding-ports)
... ...
@@ -540,13 +540,13 @@ The steps with which Docker configures a container are:
540 540
     separate and unique network interface namespace, there are no
541 541
     physical interfaces with which this name could collide.
542 542
 
543
-4.  Set the interface's mac address according to the `--mac-address`
543
+4.  Set the interface's MAC address according to the `--mac-address`
544 544
     parameter or generate a random one.
545 545
 
546 546
 5.  Give the container's `eth0` a new IP address from within the
547 547
     bridge's range of network addresses, and set its default route to
548 548
     the IP address that the Docker host owns on the bridge. If available
549
-    the IP address is generated from the MAC address. This prevents arp
549
+    the IP address is generated from the MAC address. This prevents ARP
550 550
     cache invalidation problems, when a new container comes up with an
551 551
     IP used in the past by another container with another MAC.
552 552
 
... ...
@@ -54,7 +54,7 @@ total memory available (`MemTotal`).
54 54
 
55 55
 `POST /containers/create`
56 56
 **New!**
57
-You can define the container's MAC address by providing a MacAddress key-value pair.
57
+You can set the new container's MAC address explicitly.
58 58
 
59 59
 ## v1.15
60 60
 
... ...
@@ -140,7 +140,7 @@ example, `docker run ubuntu:14.04`.
140 140
                                   'container:<name|id>': reuses another container network stack
141 141
                                   'host': use the host network stack inside the container
142 142
     --add-host=""    : Add a line to /etc/hosts (host:IP)
143
-    --mac-address="" : Sets the container's ethernet device's mac address
143
+    --mac-address="" : Sets the container's ethernet device's MAC address
144 144
 
145 145
 By default, all containers have networking enabled and they can make any
146 146
 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
151 151
 Your container will use the same DNS servers as the host by default, but
152 152
 you can override this with `--dns`.
153 153
 
154
-By default a random mac is generated. You can set the container's mac address
155
-explicitly by providing a mac via the `--mac-address` parameter (format:
156
-12:34:56:78:9a:bc).
154
+By default a random MAC is generated. You can set the container's MAC address
155
+explicitly by providing a MAC via the `--mac-address` parameter (format:
156
+`12:34:56:78:9a:bc`).
157 157
 
158 158
 Supported networking modes are:
159 159
 
... ...
@@ -2027,11 +2027,11 @@ func TestRunSetMacAddress(t *testing.T) {
2027 2027
 	}
2028 2028
 	actualMac := strings.TrimSpace(out)
2029 2029
 	if actualMac != mac {
2030
-		t.Fatalf("Set Mac Address with --mac-address failed. The container has an incorrect MAC address: %q, expected: %q", actualMac, mac)
2030
+		t.Fatalf("Set MAC address with --mac-address failed. The container has an incorrect MAC address: %q, expected: %q", actualMac, mac)
2031 2031
 	}
2032 2032
 
2033 2033
 	deleteAllContainers()
2034
-	logDone("run - setting Mac Address with --mac-address")
2034
+	logDone("run - setting MAC address with --mac-address")
2035 2035
 }
2036 2036
 
2037 2037
 func TestRunInspectMacAddress(t *testing.T) {
... ...
@@ -2047,10 +2047,10 @@ func TestRunInspectMacAddress(t *testing.T) {
2047 2047
 		t.Fatal(err)
2048 2048
 	}
2049 2049
 	if inspectedMac != mac {
2050
-		t.Fatalf("Inspecting Mac Address with failed. docker inspect shows incorrect MacAddress: %q, actual Mac: %q", inspectedMac, mac)
2050
+		t.Fatalf("docker inspect outputs wrong MAC address: %q, should be: %q", inspectedMac, mac)
2051 2051
 	}
2052 2052
 	deleteAllContainers()
2053
-	logDone("run - inspecting Mac Address")
2053
+	logDone("run - inspecting MAC address")
2054 2054
 }
2055 2055
 
2056 2056
 func TestRunDeallocatePortOnMissingIptablesRule(t *testing.T) {
... ...
@@ -59,7 +59,7 @@ func Parse(cmd *flag.FlagSet, args []string, sysInfo *sysinfo.SysInfo) (*Config,
59 59
 		flCpuShares       = cmd.Int64([]string{"c", "-cpu-shares"}, 0, "CPU shares (relative weight)")
60 60
 		flCpuset          = cmd.String([]string{"-cpuset"}, "", "CPUs in which to allow execution (0-3, 0,1)")
61 61
 		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.")
62
-		flMacAddress      = cmd.String([]string{"-mac-address"}, "", "Container MAC address (ex: 92:d0:c6:0a:29:33)")
62
+		flMacAddress      = cmd.String([]string{"-mac-address"}, "", "Container MAC address (e.g. 92:d0:c6:0a:29:33)")
63 63
 		flRestartPolicy   = cmd.String([]string{"-restart"}, "", "Restart policy to apply when a container exits (no, on-failure[:max-retry], always)")
64 64
 	)
65 65