Browse code

Adda test for using -f w/git repo on build

https://github.com/docker/docker/pull/14546 actually fixed issue #14837
but I don't see a new test to ensure we don't regress. So this PR adds
a test and then we can close #14837.

Closes #14837

Signed-off-by: Doug Davis <dug@us.ibm.com>

Doug Davis authored on 2015/07/27 23:49:42
Showing 1 changed files
... ...
@@ -4118,6 +4118,27 @@ func (s *DockerSuite) TestBuildFromGITWithContext(c *check.C) {
4118 4118
 	}
4119 4119
 }
4120 4120
 
4121
+func (s *DockerSuite) TestBuildFromGITwithF(c *check.C) {
4122
+	name := "testbuildfromgitwithf"
4123
+	git, err := newFakeGit("repo", map[string]string{
4124
+		"myApp/myDockerfile": `FROM busybox
4125
+					RUN echo hi from Dockerfile`,
4126
+	}, true)
4127
+	if err != nil {
4128
+		c.Fatal(err)
4129
+	}
4130
+	defer git.Close()
4131
+
4132
+	out, _, err := dockerCmdWithError(c, "build", "-t", name, "--no-cache", "-f", "myApp/myDockerfile", git.RepoURL)
4133
+	if err != nil {
4134
+		c.Fatalf("Error on build. Out: %s\nErr: %v", out, err)
4135
+	}
4136
+
4137
+	if !strings.Contains(out, "hi from Dockerfile") {
4138
+		c.Fatalf("Missing expected output, got:\n%s", out)
4139
+	}
4140
+}
4141
+
4121 4142
 func (s *DockerSuite) TestBuildFromRemoteTarball(c *check.C) {
4122 4143
 	name := "testbuildfromremotetarball"
4123 4144