浏览代码

Merge pull request #7948 from SvenDowideit/add-more-port-specification-doc

add -p PORT as a valid format specification
Jessie Frazelle 10 年之前
父节点
当前提交
2a832f617b
共有 4 个文件被更改,包括 4 次插入4 次删除
  1. 1 1
      docs/man/docker-run.1.md
  2. 1 1
      docs/sources/reference/commandline/cli.md
  3. 1 1
      docs/sources/reference/run.md
  4. 1 1
      nat/nat.go

+ 1 - 1
docs/man/docker-run.1.md

@@ -186,7 +186,7 @@ exposed ports, use **docker port**.
 
 
 **-p**, **--publish**=[]
 **-p**, **--publish**=[]
    Publish a container's port to the host (format: ip:hostPort:containerPort |
    Publish a container's port to the host (format: ip:hostPort:containerPort |
-ip::containerPort | hostPort:containerPort) (use **docker port** to see the
+ip::containerPort | hostPort:containerPort | containerPort) (use **docker port** to see the
 actual mapping)
 actual mapping)
 
 
 **--privileged**=*true*|*false*
 **--privileged**=*true*|*false*

+ 1 - 1
docs/sources/reference/commandline/cli.md

@@ -1010,7 +1010,7 @@ removed before the image is removed.
                                    'host': use the host network stack inside the container.  Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure.
                                    'host': use the host network stack inside the container.  Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure.
       -P, --publish-all=false    Publish all exposed ports to the host interfaces
       -P, --publish-all=false    Publish all exposed ports to the host interfaces
       -p, --publish=[]           Publish a container's port to the host
       -p, --publish=[]           Publish a container's port to the host
-                                   format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort
+                                   format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort
                                    (use 'docker port' to see the actual mapping)
                                    (use 'docker port' to see the actual mapping)
       --privileged=false         Give extended privileges to this container
       --privileged=false         Give extended privileges to this container
       --restart=""               Restart policy to apply when a container exits (no, on-failure[:max-retry], always)
       --restart=""               Restart policy to apply when a container exits (no, on-failure[:max-retry], always)

+ 1 - 1
docs/sources/reference/run.md

@@ -345,7 +345,7 @@ or override the Dockerfile's exposed defaults:
     -P=false   : Publish all exposed ports to the host interfaces
     -P=false   : Publish all exposed ports to the host interfaces
     -p=[]      : Publish a container᾿s port to the host (format:
     -p=[]      : Publish a container᾿s port to the host (format:
                  ip:hostPort:containerPort | ip::containerPort |
                  ip:hostPort:containerPort | ip::containerPort |
-                 hostPort:containerPort)
+                 hostPort:containerPort | containerPort)
                  (use 'docker port' to see the actual mapping)
                  (use 'docker port' to see the actual mapping)
     --link=""  : Add link to another container (name:alias)
     --link=""  : Add link to another container (name:alias)
 
 

+ 1 - 1
nat/nat.go

@@ -14,7 +14,7 @@ import (
 
 
 const (
 const (
 	PortSpecTemplate       = "ip:hostPort:containerPort"
 	PortSpecTemplate       = "ip:hostPort:containerPort"
-	PortSpecTemplateFormat = "ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort"
+	PortSpecTemplateFormat = "ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort"
 )
 )
 
 
 type PortBinding struct {
 type PortBinding struct {