瀏覽代碼

improved doc and usage

Victor Vieux 12 年之前
父節點
當前提交
800b401f0b
共有 3 個文件被更改,包括 17 次插入2 次删除
  1. 1 1
      commands.go
  2. 3 1
      docs/sources/commandline/cli.rst
  3. 13 0
      docs/sources/use/basics.rst

+ 1 - 1
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",

+ 3 - 1
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.
 

+ 13 - 0
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
 --------------------------------------