mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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 <SvenDowideit@home.org.au> (github: SvenDowideit)
This commit is contained in:
parent
2f514fb891
commit
5febba93ba
24 changed files with 45 additions and 45 deletions
|
@ -26,10 +26,10 @@ To see the man page for a command run **man docker <command>**.
|
|||
**-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.
|
||||
|
|
|
@ -19,7 +19,7 @@ To see the man page for a command run \fBman docker <command>\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
|
||||
|
|
|
@ -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 >
|
||||
```
|
||||
|
|
|
@ -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 <path to>/docker -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock -d &
|
||||
$ sudo <path to>/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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue