@@ -111,7 +111,7 @@ func (s *DockerSuite) TestCliRunStdinPipe(c *check.C) {
111111 // TODO Windows: This needs some work to make compatible.
112112 testRequires(c, DaemonIsLinux)
113113 printTestCaseName(); defer printTestDuration(time.Now())
114- runCmd := exec.Command(dockerBinary, "-H ", os.Getenv("DOCKER_HOST"), "run", "-i", "-a", "stdin", "busybox", "cat")
114+ runCmd := exec.Command(dockerBinary, "--region ", os.Getenv("DOCKER_HOST"), "run", "-i", "-a", "stdin", "busybox", "cat")
115115 runCmd.Stdin = strings.NewReader("blahblah")
116116 out, _, _, err := runCommandWithStdoutStderr(runCmd)
117117 if err != nil {
@@ -328,7 +328,7 @@ func (s *DockerSuite) TestCliRunEnvironment(c *check.C) {
328328 testRequires(c, DaemonIsLinux)
329329 printTestCaseName(); defer printTestDuration(time.Now())
330330 pullImageIfNotExist("busybox")
331- cmd := exec.Command(dockerBinary, "-H ", os.Getenv("DOCKER_HOST"), "run", "-h", "testing", "-e=FALSE=true", "-e=TRUE=", "-e=TRICKY=", "-e=HOME=", "busybox", "env")
331+ cmd := exec.Command(dockerBinary, "--region ", os.Getenv("DOCKER_HOST"), "run", "-h", "testing", "-e=FALSE=true", "-e=TRUE=", "-e=TRICKY=", "-e=HOME=", "busybox", "env")
332332 cmd.Env = append(os.Environ(),
333333 "TRUE=false",
334334 "TRICKY=tri\ncky\n",
@@ -376,7 +376,7 @@ func (s *DockerSuite) TestCliRunEnvironmentErase(c *check.C) {
376376 // not set in our local env that they're removed (if present) in
377377 // the container
378378
379- cmd := exec.Command(dockerBinary, "-H ", os.Getenv("DOCKER_HOST"), "run", "-e", "FOO", "-e", "HOSTNAME", "busybox", "env")
379+ cmd := exec.Command(dockerBinary, "--region ", os.Getenv("DOCKER_HOST"), "run", "-e", "FOO", "-e", "HOSTNAME", "busybox", "env")
380380 cmd.Env = appendBaseEnv([]string{})
381381
382382 out, _, err := runCommandWithOutput(cmd)
@@ -415,7 +415,7 @@ func (s *DockerSuite) TestCliRunEnvironmentOverride(c *check.C) {
415415 // Test to make sure that when we use -e on env vars that are
416416 // already in the env that we're overriding them
417417
418- cmd := exec .Command (dockerBinary , "-H " , os .Getenv ("DOCKER_HOST" ), "run" , "-e" , "HOSTNAME" , "-e" , "HOME=/root2" , "busybox" , "env" )
418+ cmd := exec .Command (dockerBinary , "--region " , os .Getenv ("DOCKER_HOST" ), "run" , "-e" , "HOSTNAME" , "-e" , "HOME=/root2" , "busybox" , "env" )
419419 cmd .Env = appendBaseEnv ([]string {"HOSTNAME=bar" })
420420
421421 out , _ , err := runCommandWithOutput (cmd )
@@ -693,7 +693,7 @@ func (s *DockerSuite) TestCliRunExitOnStdinClose(c *check.C) {
693693 meow = "cat"
694694 delay = 60
695695 }
696- runCmd := exec.Command(dockerBinary, "-H ", os.Getenv("DOCKER_HOST"), "run", "--name", name, "-i", "busybox", meow)
696+ runCmd := exec.Command(dockerBinary, "--region ", os.Getenv("DOCKER_HOST"), "run", "--name", name, "-i", "busybox", meow)
697697
698698 stdin, err := runCmd.StdinPipe()
699699 if err != nil {
@@ -976,7 +976,7 @@ func (s *DockerSuite) TestCliRunNoOutputFromPullInStdout(c *check.C) {
976976 testRequires (c , DaemonIsLinux )
977977
978978 // just run with unknown image
979- cmd := exec .Command (dockerBinary , "-H " , os .Getenv ("DOCKER_HOST" ), "run" , "asdfsg" )
979+ cmd := exec .Command (dockerBinary , "--region " , os .Getenv ("DOCKER_HOST" ), "run" , "asdfsg" )
980980 stdout := bytes .NewBuffer (nil )
981981 cmd .Stdout = stdout
982982 if err := cmd .Run (); err == nil {
@@ -995,7 +995,7 @@ func (s *DockerSuite) TestCliRunSlowStdoutConsumer(c *check.C) {
995995 testRequires(c, DaemonIsLinux)
996996 printTestCaseName(); defer printTestDuration(time.Now())
997997 pullImageIfNotExist("busybox")
998- cont := exec.Command(dockerBinary, "-H ", os.Getenv("DOCKER_HOST"), "run", "--rm", "busybox", "/bin/sh", "-c", "dd if=/dev/zero of=/dev/stdout bs=1024 count=2000 | catv")
998+ cont := exec.Command(dockerBinary, "--region ", os.Getenv("DOCKER_HOST"), "run", "--rm", "busybox", "/bin/sh", "-c", "dd if=/dev/zero of=/dev/stdout bs=1024 count=2000 | catv")
999999
10001000 stdout, err := cont.StdoutPipe()
10011001 if err != nil {
@@ -1133,7 +1133,7 @@ func (s *DockerSuite) TestCliRunTTYWithPipe(c *check.C) {
11331133 go func () {
11341134 defer close (errChan )
11351135
1136- cmd := exec .Command (dockerBinary , "-H " , os .Getenv ("DOCKER_HOST" ), "run" , "-ti" , "busybox" , "true" )
1136+ cmd := exec .Command (dockerBinary , "--region " , os .Getenv ("DOCKER_HOST" ), "run" , "-ti" , "busybox" , "true" )
11371137 if _ , err := cmd .StdinPipe (); err != nil {
11381138 errChan <- err
11391139 return
@@ -1363,7 +1363,7 @@ func (s *DockerTrustSuite) TestCliRunWhenCertExpired(c *check.C) {
13631363
13641364 runAtDifferentDate (elevenYearsFromNow , func () {
13651365 // Try run
1366- runCmd := exec .Command (dockerBinary , "-H " , os .Getenv ("DOCKER_HOST" ), "run" , repoName )
1366+ runCmd := exec .Command (dockerBinary , "--region " , os .Getenv ("DOCKER_HOST" ), "run" , repoName )
13671367 s .trustedCmd (runCmd )
13681368 out , _ , err := runCommandWithOutput (runCmd )
13691369 if err == nil {
@@ -1377,7 +1377,7 @@ func (s *DockerTrustSuite) TestCliRunWhenCertExpired(c *check.C) {
13771377
13781378 runAtDifferentDate (elevenYearsFromNow , func () {
13791379 // Try run
1380- runCmd := exec .Command (dockerBinary , "-H " , os .Getenv ("DOCKER_HOST" ), "run" , "--disable-content-trust" , repoName )
1380+ runCmd := exec .Command (dockerBinary , "--region " , os .Getenv ("DOCKER_HOST" ), "run" , "--disable-content-trust" , repoName )
13811381 s .trustedCmd (runCmd )
13821382 out , _ , err := runCommandWithOutput (runCmd )
13831383 if err != nil {
@@ -1432,7 +1432,7 @@ func (s *DockerSuite) TestCliRunStdinBlockedAfterContainerExit(c *check.C) {
14321432 testRequires (c , DaemonIsLinux )
14331433
14341434 pullImageIfNotExist ("busybox" )
1435- cmd := exec .Command (dockerBinary , "-H " , os .Getenv ("DOCKER_HOST" ), "run" , "-i" , "--name=test" , "busybox" , "true" )
1435+ cmd := exec .Command (dockerBinary , "--region " , os .Getenv ("DOCKER_HOST" ), "run" , "-i" , "--name=test" , "busybox" , "true" )
14361436 in , err := cmd .StdinPipe ()
14371437 c .Assert (err , check .IsNil )
14381438 defer in .Close ()
@@ -1459,7 +1459,7 @@ func (s *DockerSuite) TestCliRunNonExecutableCmd(c *check.C) {
14591459
14601460 pullImageIfNotExist ("busybox" )
14611461 name := "test-non-executable-cmd"
1462- runCmd := exec .Command (dockerBinary , "-H " , os .Getenv ("DOCKER_HOST" ), "run" , "--name" , name , "busybox" , "foo" )
1462+ runCmd := exec .Command (dockerBinary , "--region " , os .Getenv ("DOCKER_HOST" ), "run" , "--name" , name , "busybox" , "foo" )
14631463 _ , exit , _ := runCommandWithOutput (runCmd )
14641464 stateExitCode := findContainerExitCode (c , name )
14651465 if ! (exit == 127 && strings .Contains (stateExitCode , "127" )) {
@@ -1475,7 +1475,7 @@ func (s *DockerSuite) TestCliRunNonExistingCmd(c *check.C) {
14751475
14761476 pullImageIfNotExist ("busybox" )
14771477 name := "test-non-existing-cmd"
1478- runCmd := exec .Command (dockerBinary , "-H " , os .Getenv ("DOCKER_HOST" ), "run" , "--name" , name , "busybox" , "/bin/foo" )
1478+ runCmd := exec .Command (dockerBinary , "--region " , os .Getenv ("DOCKER_HOST" ), "run" , "--name" , name , "busybox" , "/bin/foo" )
14791479 _ , exit , _ := runCommandWithOutput (runCmd )
14801480 stateExitCode := findContainerExitCode (c , name )
14811481 if ! (exit == 127 && strings .Contains (stateExitCode , "127" )) {
@@ -1497,7 +1497,7 @@ func (s *DockerSuite) TestCliRunCmdCannotBeInvoked(c *check.C) {
14971497 expected = 127
14981498 }
14991499 name := "test-cmd-cannot-be-invoked"
1500- runCmd := exec .Command (dockerBinary , "-H " , os .Getenv ("DOCKER_HOST" ), "run" , "--name" , name , "busybox" , "/etc" )
1500+ runCmd := exec .Command (dockerBinary , "--region " , os .Getenv ("DOCKER_HOST" ), "run" , "--name" , name , "busybox" , "/etc" )
15011501 _ , exit , _ := runCommandWithOutput (runCmd )
15021502 stateExitCode := findContainerExitCode (c , name )
15031503 if ! (exit == expected && strings .Contains (stateExitCode , strconv .Itoa (expected ))) {
@@ -1511,7 +1511,7 @@ func (s *DockerSuite) TestCliRunNonExistingImage(c *check.C) {
15111511 defer printTestDuration (time .Now ())
15121512 testRequires (c , DaemonIsLinux )
15131513
1514- runCmd := exec .Command (dockerBinary , "-H " , os .Getenv ("DOCKER_HOST" ), "run" , "foo" )
1514+ runCmd := exec .Command (dockerBinary , "--region " , os .Getenv ("DOCKER_HOST" ), "run" , "foo" )
15151515 out , exit , err := runCommandWithOutput (runCmd )
15161516 if ! (err != nil && exit == 125 && strings .Contains (out , "Unable to find image" )) {
15171517 c .Fatalf ("Run non-existing image should have errored with 'Unable to find image' code 125, but we got out: %s, exit: %d, err: %s" , out , exit , err )
@@ -1525,7 +1525,7 @@ func (s *DockerSuite) TestCliRunDockerFails(c *check.C) {
15251525 testRequires (c , DaemonIsLinux )
15261526
15271527 pullImageIfNotExist ("busybox" )
1528- runCmd := exec .Command (dockerBinary , "-H " , os .Getenv ("DOCKER_HOST" ), "run" , "-foo" , "busybox" )
1528+ runCmd := exec .Command (dockerBinary , "--region " , os .Getenv ("DOCKER_HOST" ), "run" , "-foo" , "busybox" )
15291529 out , exit , err := runCommandWithOutput (runCmd )
15301530 if ! (err != nil && exit == 125 ) {
15311531 c .Fatalf ("Docker run with flag not defined should exit with 125, but we got out: %s, exit: %d, err: %s" , out , exit , err )
0 commit comments