Browse code

Merge pull request #6181 from SvenDowideit/change-out-port-number

IANA allocated Docker port: 2375

unclejack authored on 2014/06/04 07:07:48
Showing 24 changed files
... ...
@@ -26,10 +26,10 @@ To see the man page for a command run **man docker <command>**.
26 26
 **-D**=*true*|*false*
27 27
    Enable debug mode. Default is false.
28 28
 
29
-**-H**, **--host**=[unix:///var/run/docker.sock]: tcp://[host[:port]] to bind or
29
+**-H**, **--host**=[unix:///var/run/docker.sock]: tcp://[host:port] to bind or
30 30
 unix://[/path/to/socket] to use.
31
-   Enable both the socket support and TCP on localhost. When host=[0.0.0.0],
32
-port=[4243] or path =[/var/run/docker.sock] is omitted, default values are used.
31
+   The socket(s) to bind to in daemon mode specified using one or more
32
+   tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd.
33 33
 
34 34
 **--api-enable-cors**=*true*|*false*
35 35
   Enable CORS headers in the remote API. Default is false.
... ...
@@ -19,7 +19,7 @@ To see the man page for a command run \fBman docker <command>\fR.
19 19
 Enable debug mode
20 20
 .TP
21 21
 .B\-H=[unix:///var/run/docker.sock]: tcp://[host[:port]] to bind or unix://[/path/to/socket] to use. 
22
-When host=[0.0.0.0], port=[4243] or path
22
+When host=[0.0.0.0], port=[2375] or path
23 23
 =[/var/run/docker.sock] is omitted, default values are used.
24 24
 .TP
25 25
 .B \-\-api-enable-cors=false
... ...
@@ -31,20 +31,20 @@ stop on runlevel [!2345]
31 31
 respawn
32 32
 
33 33
 script
34
-    /usr/bin/docker -d -H=tcp://0.0.0.0:4243
34
+    /usr/bin/docker -d -H=tcp://0.0.0.0:2375
35 35
 end script
36 36
 ```
37 37
 
38 38
 Once that's done, you need to set up a SSH tunnel between your host machine and the vagrant machine that's running Docker. This can be done by running the following command in a host terminal:
39 39
 
40 40
 ```
41
-ssh -L 4243:localhost:4243 -p 2222 vagrant@localhost
41
+ssh -L 2375:localhost:2375 -p 2222 vagrant@localhost
42 42
 ```
43 43
 
44
-(The first 4243 is what your host can connect to, the second 4243 is what port Docker is running on in the vagrant machine, and the 2222 is the port Vagrant is providing for SSH. If VirtualBox is the VM you're using, you can see what value "2222" should be by going to: Network > Adapter 1 > Advanced > Port Forwarding in the VirtualBox GUI.)
44
+(The first 2375 is what your host can connect to, the second 2375 is what port Docker is running on in the vagrant machine, and the 2222 is the port Vagrant is providing for SSH. If VirtualBox is the VM you're using, you can see what value "2222" should be by going to: Network > Adapter 1 > Advanced > Port Forwarding in the VirtualBox GUI.)
45 45
 
46 46
 Note that because the port has been changed, to run docker commands from within the command line you must run them like this:
47 47
 
48 48
 ```
49
-sudo docker -H 0.0.0.0:4243 < commands for docker >
49
+sudo docker -H 0.0.0.0:2375 < commands for docker >
50 50
 ```
... ...
@@ -61,7 +61,7 @@ image cache.
61 61
 With `-H` it is possible to make the Docker daemon to listen on a
62 62
 specific IP and port. By default, it will listen on
63 63
 `unix:///var/run/docker.sock` to allow only local connections by the
64
-*root* user. You *could* set it to `0.0.0.0:4243` or a specific host IP
64
+*root* user. You *could* set it to `0.0.0.0:2375` or a specific host IP
65 65
 to give access to everybody, but that is **not recommended** because
66 66
 then it is trivial for someone to gain root access to the host where the
67 67
 daemon is running.
... ...
@@ -74,8 +74,8 @@ Similarly, the Docker client can use `-H` to connect to a custom port.
74 74
 
75 75
 For example:
76 76
 
77
--   `tcp://host:4243` -> TCP connection on
78
-    host:4243
77
+-   `tcp://host:2375` -> TCP connection on
78
+    host:2375
79 79
 -   `unix://path/to/socket` -> Unix socket located
80 80
     at `path/to/socket`
81 81
 
... ...
@@ -98,11 +98,11 @@ You can use multiple `-H`, for example, if you want to listen on both
98 98
 TCP and a Unix socket
99 99
 
100 100
     # Run docker in daemon mode
101
-    $ sudo <path to>/docker -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock -d &
101
+    $ sudo <path to>/docker -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -d &
102 102
     # Download an ubuntu image, use default Unix socket
103 103
     $ sudo docker pull ubuntu
104 104
     # OR use the TCP port
105
-    $ sudo docker -H tcp://127.0.0.1:4243 pull ubuntu
105
+    $ sudo docker -H tcp://127.0.0.1:2375 pull ubuntu
106 106
 
107 107
 ## Starting a long-running worker process
108 108
 
... ...
@@ -67,13 +67,13 @@ Now you can make the Docker daemon only accept connections from clients
67 67
 providing a certificate trusted by our CA:
68 68
 
69 69
     $ sudo docker -d --tlsverify --tlscacert=ca.pem --tlscert=server-cert.pem --tlskey=server-key.pem \
70
-      -H=0.0.0.0:4243
70
+      -H=0.0.0.0:2375
71 71
 
72 72
 To be able to connect to Docker and validate its certificate, you now
73 73
 need to provide your client keys, certificates and trusted CA:
74 74
 
75 75
     $ docker --tlsverify --tlscacert=ca.pem --tlscert=client-cert.pem --tlskey=client-key.pem \
76
-      -H=dns-name-of-docker-host:4243
76
+      -H=dns-name-of-docker-host:2375
77 77
 
78 78
 > **Warning**: 
79 79
 > As shown in the example above, you don't have to run the
... ...
@@ -33,7 +33,7 @@ virtual machine and run the Docker daemon.
33 33
 ```
34 34
 	boot2docker init
35 35
 	boot2docker start
36
-	export DOCKER_HOST=tcp://localhost:4243
36
+	export DOCKER_HOST=tcp://localhost:2375
37 37
 ```
38 38
 
39 39
 `boot2docker init` will ask you to enter an ssh key passphrase - the simplest
... ...
@@ -259,9 +259,9 @@ Then reload UFW:
259 259
 
260 260
 UFW's default set of rules denies all incoming traffic. If you want to
261 261
 be able to reach your containers from another host then you should allow
262
-incoming connections on the Docker port (default 4243):
262
+incoming connections on the Docker port (default 2375):
263 263
 
264
-    $ sudo ufw allow 4243/tcp
264
+    $ sudo ufw allow 2375/tcp
265 265
 
266 266
 ## Docker and local DNS server warnings
267 267
 
... ...
@@ -7,7 +7,7 @@ page_keywords: API, Docker, rcli, REST, documentation
7 7
 # 1. Brief introduction
8 8
 
9 9
 -   The Remote API is replacing rcli
10
--   Default port in the docker daemon is 4243
10
+-   Default port in the docker daemon is 2375
11 11
 -   The API tends to be REST, but for some complex commands, like attach
12 12
     or pull, the HTTP connection is hijacked to transport stdout stdin
13 13
     and stderr
... ...
@@ -7,7 +7,7 @@ page_keywords: API, Docker, rcli, REST, documentation
7 7
 # 1. Brief introduction
8 8
 
9 9
 -   The Remote API is replacing rcli
10
--   Default port in the docker daemon is 4243
10
+-   Default port in the docker daemon is 2375
11 11
 -   The API tends to be REST, but for some complex commands, like attach
12 12
     or pull, the HTTP connection is hijacked to transport stdout stdin
13 13
     and stderr
... ...
@@ -1297,4 +1297,4 @@ stdout and stderr on the same socket. This might change in the future.
1297 1297
 To enable cross origin requests to the remote api add the flag
1298 1298
 "–api-enable-cors" when running docker in daemon mode.
1299 1299
 
1300
-    $ docker -d -H="192.168.1.9:4243" --api-enable-cors
1300
+    $ docker -d -H="192.168.1.9:2375" --api-enable-cors
... ...
@@ -1358,4 +1358,4 @@ stdout and stderr on the same socket. This might change in the future.
1358 1358
 To enable cross origin requests to the remote api add the flag
1359 1359
 "–api-enable-cors" when running docker in daemon mode.
1360 1360
 
1361
-    $ docker -d -H="192.168.1.9:4243" --api-enable-cors
1361
+    $ docker -d -H="192.168.1.9:2375" --api-enable-cors
... ...
@@ -1370,4 +1370,4 @@ stdout and stderr on the same socket. This might change in the future.
1370 1370
 To enable cross origin requests to the remote api add the flag
1371 1371
 "–api-enable-cors" when running docker in daemon mode.
1372 1372
 
1373
-    $ docker -d -H="192.168.1.9:4243" --api-enable-cors
1373
+    $ docker -d -H="192.168.1.9:2375" --api-enable-cors
... ...
@@ -7,7 +7,7 @@ page_keywords: API, Docker, rcli, REST, documentation
7 7
 # 1. Brief introduction
8 8
 
9 9
 - The Remote API is replacing rcli
10
-- Default port in the docker daemon is 4243
10
+- Default port in the docker daemon is 2375
11 11
 - The API tends to be REST, but for some complex commands, like attach
12 12
   or pull, the HTTP connection is hijacked to transport stdout stdin
13 13
   and stderr
... ...
@@ -999,5 +999,5 @@ stdout and stderr on the same socket. This might change in the future.
999 999
 To enable cross origin requests to the remote api add the flag
1000 1000
 "–api-enable-cors" when running docker in daemon mode.
1001 1001
 
1002
-> docker -d -H="[tcp://192.168.1.9:4243](tcp://192.168.1.9:4243)"
1002
+> docker -d -H="[tcp://192.168.1.9:2375](tcp://192.168.1.9:2375)"
1003 1003
 > –api-enable-cors
... ...
@@ -7,7 +7,7 @@ page_keywords: API, Docker, rcli, REST, documentation
7 7
 # 1. Brief introduction
8 8
 
9 9
 - The Remote API is replacing rcli
10
-- Default port in the docker daemon is 4243
10
+- Default port in the docker daemon is 2375
11 11
 - The API tends to be REST, but for some complex commands, like attach
12 12
   or pull, the HTTP connection is hijacked to transport stdout stdin
13 13
   and stderr
... ...
@@ -1081,4 +1081,4 @@ stdout and stderr on the same socket. This might change in the future.
1081 1081
 To enable cross origin requests to the remote api add the flag
1082 1082
 "–api-enable-cors" when running docker in daemon mode.
1083 1083
 
1084
-> docker -d -H="192.168.1.9:4243" –api-enable-cors
1084
+> docker -d -H="192.168.1.9:2375" –api-enable-cors
... ...
@@ -7,7 +7,7 @@ page_keywords: API, Docker, rcli, REST, documentation
7 7
 # 1. Brief introduction
8 8
 
9 9
 - The Remote API is replacing rcli
10
-- Default port in the docker daemon is 4243
10
+- Default port in the docker daemon is 2375
11 11
 - The API tends to be REST, but for some complex commands, like attach
12 12
   or pull, the HTTP connection is hijacked to transport stdout stdin
13 13
   and stderr
... ...
@@ -1127,4 +1127,4 @@ stdout and stderr on the same socket. This might change in the future.
1127 1127
 To enable cross origin requests to the remote api add the flag
1128 1128
 "–api-enable-cors" when running docker in daemon mode.
1129 1129
 
1130
-    $ docker -d -H="192.168.1.9:4243" --api-enable-cors
1130
+    $ docker -d -H="192.168.1.9:2375" --api-enable-cors
... ...
@@ -7,7 +7,7 @@ page_keywords: API, Docker, rcli, REST, documentation
7 7
 # 1. Brief introduction
8 8
 
9 9
 - The Remote API is replacing rcli
10
-- Default port in the docker daemon is 4243
10
+- Default port in the docker daemon is 2375
11 11
 - The API tends to be REST, but for some complex commands, like attach
12 12
   or pull, the HTTP connection is hijacked to transport stdout stdin
13 13
   and stderr
... ...
@@ -1134,4 +1134,4 @@ stdout and stderr on the same socket. This might change in the future.
1134 1134
 To enable cross origin requests to the remote api add the flag
1135 1135
 "–api-enable-cors" when running docker in daemon mode.
1136 1136
 
1137
-    $ docker -d -H="192.168.1.9:4243" --api-enable-cors
1137
+    $ docker -d -H="192.168.1.9:2375" --api-enable-cors
... ...
@@ -1235,4 +1235,4 @@ stdout and stderr on the same socket. This might change in the future.
1235 1235
 To enable cross origin requests to the remote api add the flag
1236 1236
 "–api-enable-cors" when running docker in daemon mode.
1237 1237
 
1238
-    $ docker -d -H="192.168.1.9:4243" --api-enable-cors
1238
+    $ docker -d -H="192.168.1.9:2375" --api-enable-cors
... ...
@@ -1229,4 +1229,4 @@ stdout and stderr on the same socket. This might change in the future.
1229 1229
 To enable cross origin requests to the remote api add the flag
1230 1230
 "–api-enable-cors" when running docker in daemon mode.
1231 1231
 
1232
-    $ docker -d -H="192.168.1.9:4243" --api-enable-cors
1232
+    $ docker -d -H="192.168.1.9:2375" --api-enable-cors
... ...
@@ -1275,4 +1275,4 @@ stdout and stderr on the same socket. This might change in the future.
1275 1275
 To enable cross origin requests to the remote api add the flag
1276 1276
 "–api-enable-cors" when running docker in daemon mode.
1277 1277
 
1278
-    $ docker -d -H="192.168.1.9:4243" --api-enable-cors
1278
+    $ docker -d -H="192.168.1.9:2375" --api-enable-cors
... ...
@@ -1312,4 +1312,4 @@ stdout and stderr on the same socket. This might change in the future.
1312 1312
 To enable cross origin requests to the remote api add the flag
1313 1313
 "–api-enable-cors" when running docker in daemon mode.
1314 1314
 
1315
-    $ docker -d -H="192.168.1.9:4243" --api-enable-cors
1315
+    $ docker -d -H="192.168.1.9:2375" --api-enable-cors
... ...
@@ -103,9 +103,9 @@ To use lxc as the execution driver, use `docker -d -e lxc`.
103 103
 The docker client will also honor the `DOCKER_HOST` environment variable to set
104 104
 the `-H` flag for the client.
105 105
 
106
-    $ docker -H tcp://0.0.0.0:4243 ps
106
+    $ docker -H tcp://0.0.0.0:2375 ps
107 107
     # or
108
-    $ export DOCKER_HOST="tcp://0.0.0.0:4243"
108
+    $ export DOCKER_HOST="tcp://0.0.0.0:2375"
109 109
     $ docker ps
110 110
     # both are equal
111 111
 
... ...
@@ -683,12 +683,12 @@ func TestBuildRelativeWorkdir(t *testing.T) {
683 683
 
684 684
 func TestBuildEnv(t *testing.T) {
685 685
 	name := "testbuildenv"
686
-	expected := "[HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PORT=4243]"
686
+	expected := "[HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PORT=2375]"
687 687
 	defer deleteImages(name)
688 688
 	_, err := buildImage(name,
689 689
 		`FROM busybox
690
-        ENV PORT 4243
691
-		RUN [ $(env | grep PORT) = 'PORT=4243' ]`,
690
+        ENV PORT 2375
691
+		RUN [ $(env | grep PORT) = 'PORT=2375' ]`,
692 692
 		true)
693 693
 	if err != nil {
694 694
 		t.Fatal(err)
... ...
@@ -726,11 +726,11 @@ func TestBuildCmd(t *testing.T) {
726 726
 
727 727
 func TestBuildExpose(t *testing.T) {
728 728
 	name := "testbuildexpose"
729
-	expected := "map[4243/tcp:map[]]"
729
+	expected := "map[2375/tcp:map[]]"
730 730
 	defer deleteImages(name)
731 731
 	_, err := buildImage(name,
732 732
 		`FROM scratch
733
-        EXPOSE 4243`,
733
+        EXPOSE 2375`,
734 734
 		true)
735 735
 	if err != nil {
736 736
 		t.Fatal(err)
... ...
@@ -545,7 +545,7 @@ func TestBuildInheritance(t *testing.T) {
545 545
 
546 546
 	img, err := buildImage(testContextTemplate{`
547 547
             from {IMAGE}
548
-            expose 4243
548
+            expose 2375
549 549
             `,
550 550
 		nil, nil}, t, eng, true)
551 551
 
... ...
@@ -569,7 +569,7 @@ func TestBuildInheritance(t *testing.T) {
569 569
 	}
570 570
 
571 571
 	// from parent
572
-	if _, exists := img.Config.ExposedPorts[nat.NewPort("tcp", "4243")]; !exists {
572
+	if _, exists := img.Config.ExposedPorts[nat.NewPort("tcp", "2375")]; !exists {
573 573
 		t.Fail()
574 574
 	}
575 575
 }
... ...
@@ -302,7 +302,7 @@ func TestParseHost(t *testing.T) {
302 302
 	if addr, err := ParseHost(defaultHttpHost, defaultUnix, "udp://127.0.0.1"); err == nil {
303 303
 		t.Errorf("udp protocol address expected error return, but err == nil. Got %s", addr)
304 304
 	}
305
-	if addr, err := ParseHost(defaultHttpHost, defaultUnix, "udp://127.0.0.1:4243"); err == nil {
305
+	if addr, err := ParseHost(defaultHttpHost, defaultUnix, "udp://127.0.0.1:2375"); err == nil {
306 306
 		t.Errorf("udp protocol address expected error return, but err == nil. Got %s", addr)
307 307
 	}
308 308
 }