| ... | ... |
@@ -1026,5 +1026,5 @@ In this version of the API, /attach, uses hijacking to transport stdin, stdout a |
| 1026 | 1026 |
|
| 1027 | 1027 |
To enable cross origin requests to the remote api add the flag "-api-enable-cors" when running docker in daemon mode. |
| 1028 | 1028 |
|
| 1029 |
- docker -d -H="192.168.1.9:4243" -api-enable-cors |
|
| 1029 |
+ docker -d -H="tcp://192.168.1.9:4243" -api-enable-cors |
|
| 1030 | 1030 |
|
| ... | ... |
@@ -15,7 +15,7 @@ To list available commands, either run ``docker`` with no parameters or execute |
| 15 | 15 |
|
| 16 | 16 |
$ docker |
| 17 | 17 |
Usage: docker [OPTIONS] COMMAND [arg...] |
| 18 |
- -H="127.0.0.1:4243": Host:port to bind/connect to |
|
| 18 |
+ -H=[tcp://127.0.0.1:4243]: tcp://host:port to bind/connect to or unix://path/to/socket to use |
|
| 19 | 19 |
|
| 20 | 20 |
A self-sufficient runtime for linux containers. |
| 21 | 21 |
|
| ... | ... |
@@ -33,11 +33,16 @@ Running an interactive shell |
| 33 | 33 |
# allocate a tty, attach stdin and stdout |
| 34 | 34 |
docker run -i -t base /bin/bash |
| 35 | 35 |
|
| 36 |
-Bind Docker to another host/port |
|
| 36 |
+Bind Docker to another host/port or a unix socket |
|
| 37 |
+------------------------------------------------- |
|
| 37 | 38 |
|
| 38 | 39 |
If you want Docker to listen to another port and bind to another ip |
| 39 |
-use -host and -port on both deamon and client |
|
| 40 |
+use -H on both deamon and client. |
|
| 41 |
+-H could be (if no sheme, tcp is assumed): |
|
| 42 |
+* tcp://host -> tcp connection on host:4243 |
|
| 43 |
+* tcp://host:port -> tcp connection on host:port |
|
| 44 |
+* tcp://:port -> tcp connection on 127.0.0.1:port |
|
| 45 |
+* unix://path/to/socket -> unix socket located at path/to/socket |
|
| 40 | 46 |
|
| 41 | 47 |
.. code-block:: bash |
| 42 | 48 |
|
| ... | ... |
@@ -46,6 +51,17 @@ use -host and -port on both deamon and client |
| 46 | 46 |
# Download a base image |
| 47 | 47 |
docker -H :5555 pull base |
| 48 | 48 |
|
| 49 |
+You can use multiple -H, for exemple, if you want to listen |
|
| 50 |
+on both tcp and a unix socket |
|
| 51 |
+ |
|
| 52 |
+.. code-block:: bash |
|
| 53 |
+ |
|
| 54 |
+ # Run docker in daemon mode |
|
| 55 |
+ sudo <path to>/docker -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock |
|
| 56 |
+ # Download a base image |
|
| 57 |
+ docker pull base |
|
| 58 |
+ # OR |
|
| 59 |
+ docker -H unix:///var/run/docker.sock pull base |
|
| 49 | 60 |
|
| 50 | 61 |
Starting a long-running worker process |
| 51 | 62 |
-------------------------------------- |