Browse code

add host name parameter to "run" command

fixes #243

Mikhail Sobolev authored on 2013/04/02 05:03:24
Showing 2 changed files
... ...
@@ -67,6 +67,7 @@ func ParseRun(args []string, stdout io.Writer) (*Config, error) {
67 67
 		cmd.SetOutput(ioutil.Discard)
68 68
 	}
69 69
 
70
+	flHostname := cmd.String("h", "", "Container host name")
70 71
 	flUser := cmd.String("u", "", "Username or UID")
71 72
 	flDetach := cmd.Bool("d", false, "Detached mode: leave the container running in the background")
72 73
 	flStdin := cmd.Bool("i", false, "Keep stdin open even if not attached")
... ...
@@ -92,6 +93,7 @@ func ParseRun(args []string, stdout io.Writer) (*Config, error) {
92 92
 		runCmd = parsedArgs[1:]
93 93
 	}
94 94
 	config := &Config{
95
+		Hostname:  *flHostname,
95 96
 		Ports:     flPorts,
96 97
 		User:      *flUser,
97 98
 		Tty:       *flTty,
... ...
@@ -264,6 +264,7 @@ run
264 264
     -m=0: Memory limit (in bytes)
265 265
     -p=[]: Map a network port to the container
266 266
     -t=false: Allocate a pseudo-tty
267
+    -h="": Container host name
267 268
     -u="": Username or UID
268 269
 
269 270