From 5febba93babcf8c4b01862e88b6f6e11a1532bc8 Mon Sep 17 00:00:00 2001 From: SvenDowideit Date: Wed, 4 Jun 2014 05:44:20 +1000 Subject: [PATCH] IANA allocated Docker port: 2375 2375/2376 are assigned: http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=docker For #1440 Docker-DCO-1.1-Signed-off-by: SvenDowideit (github: SvenDowideit) --- contrib/man/md/docker.1.md | 6 +++--- contrib/man/old-man/docker.1 | 2 +- contrib/vagrant-docker/README.md | 8 ++++---- docs/sources/articles/basics.md | 10 +++++----- docs/sources/articles/https.md | 4 ++-- docs/sources/installation/mac.md | 2 +- docs/sources/installation/ubuntulinux.md | 4 ++-- docs/sources/reference/api/docker_remote_api_v1.0.md | 2 +- docs/sources/reference/api/docker_remote_api_v1.1.md | 2 +- docs/sources/reference/api/docker_remote_api_v1.10.md | 2 +- docs/sources/reference/api/docker_remote_api_v1.11.md | 2 +- docs/sources/reference/api/docker_remote_api_v1.12.md | 2 +- docs/sources/reference/api/docker_remote_api_v1.2.md | 4 ++-- docs/sources/reference/api/docker_remote_api_v1.3.md | 4 ++-- docs/sources/reference/api/docker_remote_api_v1.4.md | 4 ++-- docs/sources/reference/api/docker_remote_api_v1.5.md | 4 ++-- docs/sources/reference/api/docker_remote_api_v1.6.md | 2 +- docs/sources/reference/api/docker_remote_api_v1.7.md | 2 +- docs/sources/reference/api/docker_remote_api_v1.8.md | 2 +- docs/sources/reference/api/docker_remote_api_v1.9.md | 2 +- docs/sources/reference/commandline/cli.md | 4 ++-- integration-cli/docker_cli_build_test.go | 10 +++++----- integration/buildfile_test.go | 4 ++-- utils/utils_test.go | 2 +- 24 files changed, 45 insertions(+), 45 deletions(-) diff --git a/contrib/man/md/docker.1.md b/contrib/man/md/docker.1.md index c73b083e6..f990e5162 100644 --- a/contrib/man/md/docker.1.md +++ b/contrib/man/md/docker.1.md @@ -26,10 +26,10 @@ To see the man page for a command run **man docker **. **-D**=*true*|*false* Enable debug mode. Default is false. -**-H**, **--host**=[unix:///var/run/docker.sock]: tcp://[host[:port]] to bind or +**-H**, **--host**=[unix:///var/run/docker.sock]: tcp://[host:port] to bind or unix://[/path/to/socket] to use. - Enable both the socket support and TCP on localhost. When host=[0.0.0.0], -port=[4243] or path =[/var/run/docker.sock] is omitted, default values are used. + The socket(s) to bind to in daemon mode specified using one or more + tcp://host:port, unix:///path/to/socket, fd://* or fd://socketfd. **--api-enable-cors**=*true*|*false* Enable CORS headers in the remote API. Default is false. diff --git a/contrib/man/old-man/docker.1 b/contrib/man/old-man/docker.1 index 5a5586512..95f60891c 100644 --- a/contrib/man/old-man/docker.1 +++ b/contrib/man/old-man/docker.1 @@ -19,7 +19,7 @@ To see the man page for a command run \fBman docker \fR. Enable debug mode .TP .B\-H=[unix:///var/run/docker.sock]: tcp://[host[:port]] to bind or unix://[/path/to/socket] to use. -When host=[0.0.0.0], port=[4243] or path +When host=[0.0.0.0], port=[2375] or path =[/var/run/docker.sock] is omitted, default values are used. .TP .B \-\-api-enable-cors=false diff --git a/contrib/vagrant-docker/README.md b/contrib/vagrant-docker/README.md index d422492fe..4ef9c2877 100644 --- a/contrib/vagrant-docker/README.md +++ b/contrib/vagrant-docker/README.md @@ -31,20 +31,20 @@ stop on runlevel [!2345] respawn script - /usr/bin/docker -d -H=tcp://0.0.0.0:4243 + /usr/bin/docker -d -H=tcp://0.0.0.0:2375 end script ``` 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: ``` -ssh -L 4243:localhost:4243 -p 2222 vagrant@localhost +ssh -L 2375:localhost:2375 -p 2222 vagrant@localhost ``` -(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.) +(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.) Note that because the port has been changed, to run docker commands from within the command line you must run them like this: ``` -sudo docker -H 0.0.0.0:4243 < commands for docker > +sudo docker -H 0.0.0.0:2375 < commands for docker > ``` diff --git a/docs/sources/articles/basics.md b/docs/sources/articles/basics.md index 1f21e3454..cd4a9df65 100644 --- a/docs/sources/articles/basics.md +++ b/docs/sources/articles/basics.md @@ -61,7 +61,7 @@ image cache. With `-H` it is possible to make the Docker daemon to listen on a specific IP and port. By default, it will listen on `unix:///var/run/docker.sock` to allow only local connections by the -*root* user. You *could* set it to `0.0.0.0:4243` or a specific host IP +*root* user. You *could* set it to `0.0.0.0:2375` or a specific host IP to give access to everybody, but that is **not recommended** because then it is trivial for someone to gain root access to the host where the daemon is running. @@ -74,8 +74,8 @@ Similarly, the Docker client can use `-H` to connect to a custom port. For example: -- `tcp://host:4243` -> TCP connection on - host:4243 +- `tcp://host:2375` -> TCP connection on + host:2375 - `unix://path/to/socket` -> Unix socket located at `path/to/socket` @@ -98,11 +98,11 @@ You can use multiple `-H`, for example, if you want to listen on both TCP and a Unix socket # Run docker in daemon mode - $ sudo /docker -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock -d & + $ sudo /docker -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -d & # Download an ubuntu image, use default Unix socket $ sudo docker pull ubuntu # OR use the TCP port - $ sudo docker -H tcp://127.0.0.1:4243 pull ubuntu + $ sudo docker -H tcp://127.0.0.1:2375 pull ubuntu ## Starting a long-running worker process diff --git a/docs/sources/articles/https.md b/docs/sources/articles/https.md index c46cf6b88..cc8c6a976 100644 --- a/docs/sources/articles/https.md +++ b/docs/sources/articles/https.md @@ -67,13 +67,13 @@ Now you can make the Docker daemon only accept connections from clients providing a certificate trusted by our CA: $ sudo docker -d --tlsverify --tlscacert=ca.pem --tlscert=server-cert.pem --tlskey=server-key.pem \ - -H=0.0.0.0:4243 + -H=0.0.0.0:2375 To be able to connect to Docker and validate its certificate, you now need to provide your client keys, certificates and trusted CA: $ docker --tlsverify --tlscacert=ca.pem --tlscert=client-cert.pem --tlskey=client-key.pem \ - -H=dns-name-of-docker-host:4243 + -H=dns-name-of-docker-host:2375 > **Warning**: > As shown in the example above, you don't have to run the diff --git a/docs/sources/installation/mac.md b/docs/sources/installation/mac.md index 135130ef8..c450cd12d 100644 --- a/docs/sources/installation/mac.md +++ b/docs/sources/installation/mac.md @@ -33,7 +33,7 @@ virtual machine and run the Docker daemon. ``` boot2docker init boot2docker start - export DOCKER_HOST=tcp://localhost:4243 + export DOCKER_HOST=tcp://localhost:2375 ``` `boot2docker init` will ask you to enter an ssh key passphrase - the simplest diff --git a/docs/sources/installation/ubuntulinux.md b/docs/sources/installation/ubuntulinux.md index bd32802bb..78a0679e5 100644 --- a/docs/sources/installation/ubuntulinux.md +++ b/docs/sources/installation/ubuntulinux.md @@ -259,9 +259,9 @@ Then reload UFW: UFW's default set of rules denies all incoming traffic. If you want to be able to reach your containers from another host then you should allow -incoming connections on the Docker port (default 4243): +incoming connections on the Docker port (default 2375): - $ sudo ufw allow 4243/tcp + $ sudo ufw allow 2375/tcp ## Docker and local DNS server warnings diff --git a/docs/sources/reference/api/docker_remote_api_v1.0.md b/docs/sources/reference/api/docker_remote_api_v1.0.md index d719ca27e..ba5338c5f 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.0.md +++ b/docs/sources/reference/api/docker_remote_api_v1.0.md @@ -7,7 +7,7 @@ page_keywords: API, Docker, rcli, REST, documentation # 1. Brief introduction - The Remote API is replacing rcli -- Default port in the docker daemon is 4243 +- Default port in the docker daemon is 2375 - The API tends to be REST, but for some complex commands, like attach or pull, the HTTP connection is hijacked to transport stdout stdin and stderr diff --git a/docs/sources/reference/api/docker_remote_api_v1.1.md b/docs/sources/reference/api/docker_remote_api_v1.1.md index 21997e548..b884ee69d 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.1.md +++ b/docs/sources/reference/api/docker_remote_api_v1.1.md @@ -7,7 +7,7 @@ page_keywords: API, Docker, rcli, REST, documentation # 1. Brief introduction - The Remote API is replacing rcli -- Default port in the docker daemon is 4243 +- Default port in the docker daemon is 2375 - The API tends to be REST, but for some complex commands, like attach or pull, the HTTP connection is hijacked to transport stdout stdin and stderr diff --git a/docs/sources/reference/api/docker_remote_api_v1.10.md b/docs/sources/reference/api/docker_remote_api_v1.10.md index 336edfbe5..8676833af 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.10.md +++ b/docs/sources/reference/api/docker_remote_api_v1.10.md @@ -1297,4 +1297,4 @@ stdout and stderr on the same socket. This might change in the future. To enable cross origin requests to the remote api add the flag "–api-enable-cors" when running docker in daemon mode. - $ docker -d -H="192.168.1.9:4243" --api-enable-cors + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/docs/sources/reference/api/docker_remote_api_v1.11.md b/docs/sources/reference/api/docker_remote_api_v1.11.md index 4133deaea..b77b33b09 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.11.md +++ b/docs/sources/reference/api/docker_remote_api_v1.11.md @@ -1358,4 +1358,4 @@ stdout and stderr on the same socket. This might change in the future. To enable cross origin requests to the remote api add the flag "–api-enable-cors" when running docker in daemon mode. - $ docker -d -H="192.168.1.9:4243" --api-enable-cors + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/docs/sources/reference/api/docker_remote_api_v1.12.md b/docs/sources/reference/api/docker_remote_api_v1.12.md index 23afa36bc..1bc1591d7 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.12.md +++ b/docs/sources/reference/api/docker_remote_api_v1.12.md @@ -1370,4 +1370,4 @@ stdout and stderr on the same socket. This might change in the future. To enable cross origin requests to the remote api add the flag "–api-enable-cors" when running docker in daemon mode. - $ docker -d -H="192.168.1.9:4243" --api-enable-cors + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/docs/sources/reference/api/docker_remote_api_v1.2.md b/docs/sources/reference/api/docker_remote_api_v1.2.md index 17967eab3..e231cff02 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.2.md +++ b/docs/sources/reference/api/docker_remote_api_v1.2.md @@ -7,7 +7,7 @@ page_keywords: API, Docker, rcli, REST, documentation # 1. Brief introduction - The Remote API is replacing rcli -- Default port in the docker daemon is 4243 +- Default port in the docker daemon is 2375 - The API tends to be REST, but for some complex commands, like attach or pull, the HTTP connection is hijacked to transport stdout stdin and stderr @@ -999,5 +999,5 @@ stdout and stderr on the same socket. This might change in the future. To enable cross origin requests to the remote api add the flag "–api-enable-cors" when running docker in daemon mode. -> docker -d -H="[tcp://192.168.1.9:4243](tcp://192.168.1.9:4243)" +> docker -d -H="[tcp://192.168.1.9:2375](tcp://192.168.1.9:2375)" > –api-enable-cors diff --git a/docs/sources/reference/api/docker_remote_api_v1.3.md b/docs/sources/reference/api/docker_remote_api_v1.3.md index 9f7bd22e3..71c70273f 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.3.md +++ b/docs/sources/reference/api/docker_remote_api_v1.3.md @@ -7,7 +7,7 @@ page_keywords: API, Docker, rcli, REST, documentation # 1. Brief introduction - The Remote API is replacing rcli -- Default port in the docker daemon is 4243 +- Default port in the docker daemon is 2375 - The API tends to be REST, but for some complex commands, like attach or pull, the HTTP connection is hijacked to transport stdout stdin and stderr @@ -1081,4 +1081,4 @@ stdout and stderr on the same socket. This might change in the future. To enable cross origin requests to the remote api add the flag "–api-enable-cors" when running docker in daemon mode. -> docker -d -H="192.168.1.9:4243" –api-enable-cors +> docker -d -H="192.168.1.9:2375" –api-enable-cors diff --git a/docs/sources/reference/api/docker_remote_api_v1.4.md b/docs/sources/reference/api/docker_remote_api_v1.4.md index 2e7e94f7d..253944fd9 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.4.md +++ b/docs/sources/reference/api/docker_remote_api_v1.4.md @@ -7,7 +7,7 @@ page_keywords: API, Docker, rcli, REST, documentation # 1. Brief introduction - The Remote API is replacing rcli -- Default port in the docker daemon is 4243 +- Default port in the docker daemon is 2375 - The API tends to be REST, but for some complex commands, like attach or pull, the HTTP connection is hijacked to transport stdout stdin and stderr @@ -1127,4 +1127,4 @@ stdout and stderr on the same socket. This might change in the future. To enable cross origin requests to the remote api add the flag "–api-enable-cors" when running docker in daemon mode. - $ docker -d -H="192.168.1.9:4243" --api-enable-cors + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/docs/sources/reference/api/docker_remote_api_v1.5.md b/docs/sources/reference/api/docker_remote_api_v1.5.md index 08457bfd9..7dc5334f4 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.5.md +++ b/docs/sources/reference/api/docker_remote_api_v1.5.md @@ -7,7 +7,7 @@ page_keywords: API, Docker, rcli, REST, documentation # 1. Brief introduction - The Remote API is replacing rcli -- Default port in the docker daemon is 4243 +- Default port in the docker daemon is 2375 - The API tends to be REST, but for some complex commands, like attach or pull, the HTTP connection is hijacked to transport stdout stdin and stderr @@ -1134,4 +1134,4 @@ stdout and stderr on the same socket. This might change in the future. To enable cross origin requests to the remote api add the flag "–api-enable-cors" when running docker in daemon mode. - $ docker -d -H="192.168.1.9:4243" --api-enable-cors + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/docs/sources/reference/api/docker_remote_api_v1.6.md b/docs/sources/reference/api/docker_remote_api_v1.6.md index cd5b949c6..021a357b7 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.6.md +++ b/docs/sources/reference/api/docker_remote_api_v1.6.md @@ -1235,4 +1235,4 @@ stdout and stderr on the same socket. This might change in the future. To enable cross origin requests to the remote api add the flag "–api-enable-cors" when running docker in daemon mode. - $ docker -d -H="192.168.1.9:4243" --api-enable-cors + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/docs/sources/reference/api/docker_remote_api_v1.7.md b/docs/sources/reference/api/docker_remote_api_v1.7.md index 3ad2a729c..02073e9b6 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.7.md +++ b/docs/sources/reference/api/docker_remote_api_v1.7.md @@ -1229,4 +1229,4 @@ stdout and stderr on the same socket. This might change in the future. To enable cross origin requests to the remote api add the flag "–api-enable-cors" when running docker in daemon mode. - $ docker -d -H="192.168.1.9:4243" --api-enable-cors + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/docs/sources/reference/api/docker_remote_api_v1.8.md b/docs/sources/reference/api/docker_remote_api_v1.8.md index 597922e1f..a691930c6 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.8.md +++ b/docs/sources/reference/api/docker_remote_api_v1.8.md @@ -1275,4 +1275,4 @@ stdout and stderr on the same socket. This might change in the future. To enable cross origin requests to the remote api add the flag "–api-enable-cors" when running docker in daemon mode. - $ docker -d -H="192.168.1.9:4243" --api-enable-cors + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/docs/sources/reference/api/docker_remote_api_v1.9.md b/docs/sources/reference/api/docker_remote_api_v1.9.md index 2030959f9..d67443fd2 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.9.md +++ b/docs/sources/reference/api/docker_remote_api_v1.9.md @@ -1312,4 +1312,4 @@ stdout and stderr on the same socket. This might change in the future. To enable cross origin requests to the remote api add the flag "–api-enable-cors" when running docker in daemon mode. - $ docker -d -H="192.168.1.9:4243" --api-enable-cors + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/docs/sources/reference/commandline/cli.md b/docs/sources/reference/commandline/cli.md index 829f13b9a..f9c7ad424 100644 --- a/docs/sources/reference/commandline/cli.md +++ b/docs/sources/reference/commandline/cli.md @@ -103,9 +103,9 @@ To use lxc as the execution driver, use `docker -d -e lxc`. The docker client will also honor the `DOCKER_HOST` environment variable to set the `-H` flag for the client. - $ docker -H tcp://0.0.0.0:4243 ps + $ docker -H tcp://0.0.0.0:2375 ps # or - $ export DOCKER_HOST="tcp://0.0.0.0:4243" + $ export DOCKER_HOST="tcp://0.0.0.0:2375" $ docker ps # both are equal diff --git a/integration-cli/docker_cli_build_test.go b/integration-cli/docker_cli_build_test.go index 7f6271a38..f00023584 100644 --- a/integration-cli/docker_cli_build_test.go +++ b/integration-cli/docker_cli_build_test.go @@ -683,12 +683,12 @@ func TestBuildRelativeWorkdir(t *testing.T) { func TestBuildEnv(t *testing.T) { name := "testbuildenv" - expected := "[HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PORT=4243]" + expected := "[HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PORT=2375]" defer deleteImages(name) _, err := buildImage(name, `FROM busybox - ENV PORT 4243 - RUN [ $(env | grep PORT) = 'PORT=4243' ]`, + ENV PORT 2375 + RUN [ $(env | grep PORT) = 'PORT=2375' ]`, true) if err != nil { t.Fatal(err) @@ -726,11 +726,11 @@ func TestBuildCmd(t *testing.T) { func TestBuildExpose(t *testing.T) { name := "testbuildexpose" - expected := "map[4243/tcp:map[]]" + expected := "map[2375/tcp:map[]]" defer deleteImages(name) _, err := buildImage(name, `FROM scratch - EXPOSE 4243`, + EXPOSE 2375`, true) if err != nil { t.Fatal(err) diff --git a/integration/buildfile_test.go b/integration/buildfile_test.go index f91d5c2a6..8c02cf043 100644 --- a/integration/buildfile_test.go +++ b/integration/buildfile_test.go @@ -545,7 +545,7 @@ func TestBuildInheritance(t *testing.T) { img, err := buildImage(testContextTemplate{` from {IMAGE} - expose 4243 + expose 2375 `, nil, nil}, t, eng, true) @@ -569,7 +569,7 @@ func TestBuildInheritance(t *testing.T) { } // from parent - if _, exists := img.Config.ExposedPorts[nat.NewPort("tcp", "4243")]; !exists { + if _, exists := img.Config.ExposedPorts[nat.NewPort("tcp", "2375")]; !exists { t.Fail() } } diff --git a/utils/utils_test.go b/utils/utils_test.go index 83164c68d..63d722ed0 100644 --- a/utils/utils_test.go +++ b/utils/utils_test.go @@ -302,7 +302,7 @@ func TestParseHost(t *testing.T) { if addr, err := ParseHost(defaultHttpHost, defaultUnix, "udp://127.0.0.1"); err == nil { t.Errorf("udp protocol address expected error return, but err == nil. Got %s", addr) } - if addr, err := ParseHost(defaultHttpHost, defaultUnix, "udp://127.0.0.1:4243"); err == nil { + if addr, err := ParseHost(defaultHttpHost, defaultUnix, "udp://127.0.0.1:2375"); err == nil { t.Errorf("udp protocol address expected error return, but err == nil. Got %s", addr) } }