From 800b401f0ba706f8f09b5beacd335caf4548e63c Mon Sep 17 00:00:00 2001
From: Victor Vieux <victor.vieux@dotcloud.com>
Date: Wed, 22 May 2013 16:15:52 +0000
Subject: [PATCH] improved doc and usage

---
 commands.go                      |  2 +-
 docs/sources/commandline/cli.rst |  4 +++-
 docs/sources/use/basics.rst      | 13 +++++++++++++
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/commands.go b/commands.go
index 0d7dc0e8a1..50f8533a27 100644
--- a/commands.go
+++ b/commands.go
@@ -53,7 +53,7 @@ func ParseCommands(host string, port int, args ...string) error {
 }
 
 func (cli *DockerCli) CmdHelp(args ...string) error {
-	help := "Usage: docker COMMAND [arg...]\n\nA self-sufficient runtime for linux containers.\n\nCommands:\n"
+	help := "Usage: docker [OPTIONS] COMMAND [arg...]\n  -host=\"0.0.0.0\": Host to bind/connect to\n  -port=4243: Port to listen/connect to\n\nA self-sufficient runtime for linux containers.\n\nCommands:\n"
 	for cmd, description := range map[string]string{
 		"attach":  "Attach to a running container",
 		"build":   "Build a container from Dockerfile or via stdin",
diff --git a/docs/sources/commandline/cli.rst b/docs/sources/commandline/cli.rst
index 1a341d3e5d..8ea3d19354 100644
--- a/docs/sources/commandline/cli.rst
+++ b/docs/sources/commandline/cli.rst
@@ -14,7 +14,9 @@ To list available commands, either run ``docker`` with no parameters or execute
 ``docker help``::
 
   $ docker
-    Usage: docker COMMAND [arg...]
+    Usage: docker [OPTIONS] COMMAND [arg...]
+      -host="0.0.0.0": Host to bind/connect to
+      -port=4243: Port to listen/connect to
 
     A self-sufficient runtime for linux containers.
 
diff --git a/docs/sources/use/basics.rst b/docs/sources/use/basics.rst
index ffd2a7b96c..9a5f8faf41 100644
--- a/docs/sources/use/basics.rst
+++ b/docs/sources/use/basics.rst
@@ -33,6 +33,19 @@ Running an interactive shell
   # allocate a tty, attach stdin and stdout
   docker run -i -t base /bin/bash
 
+Bind Docker to another host/port
+--------------------------------
+
+If you want Docker to listen to another port and bind to another ip
+use -host and -port on both deamon and client
+
+.. code-block:: bash
+
+   # Run docker in daemon mode
+   sudo <path to>/docker -host 127.0.0.1 -port 5555 &
+   # Download a base image
+   docker -port 5555 pull base
+
 
 Starting a long-running worker process
 --------------------------------------