From d8835404400d46dfe475fa3bad9f1b9fb8396bef Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Mon, 27 Jul 2015 07:49:42 -0700 Subject: [PATCH] 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 --- integration-cli/docker_cli_build_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/integration-cli/docker_cli_build_test.go b/integration-cli/docker_cli_build_test.go index 72f796ed66..a5ee0d23d1 100644 --- a/integration-cli/docker_cli_build_test.go +++ b/integration-cli/docker_cli_build_test.go @@ -4118,6 +4118,27 @@ func (s *DockerSuite) TestBuildFromGITWithContext(c *check.C) { } } +func (s *DockerSuite) TestBuildFromGITwithF(c *check.C) { + name := "testbuildfromgitwithf" + git, err := newFakeGit("repo", map[string]string{ + "myApp/myDockerfile": `FROM busybox + RUN echo hi from Dockerfile`, + }, true) + if err != nil { + c.Fatal(err) + } + defer git.Close() + + out, _, err := dockerCmdWithError(c, "build", "-t", name, "--no-cache", "-f", "myApp/myDockerfile", git.RepoURL) + if err != nil { + c.Fatalf("Error on build. Out: %s\nErr: %v", out, err) + } + + if !strings.Contains(out, "hi from Dockerfile") { + c.Fatalf("Missing expected output, got:\n%s", out) + } +} + func (s *DockerSuite) TestBuildFromRemoteTarball(c *check.C) { name := "testbuildfromremotetarball"