summaryrefslogtreecommitdiff
path: root/integration-cli/docker_api_build_test.go
diff options
context:
space:
mode:
authorDaniel Nephin <dnephin@docker.com>2017-06-02 16:06:14 -0400
committerDaniel Nephin <dnephin@docker.com>2017-06-02 17:47:03 -0400
commit3f2604157790408acf5ad05c74cebe105f2b6979 (patch)
tree25148c19e287a666f0f148096024466206e11115 /integration-cli/docker_api_build_test.go
parentaebcdf21b198f1ebaa7bb047282112b74f9f4490 (diff)
downloaddocker-3f2604157790408acf5ad05c74cebe105f2b6979.tar.gz
Fix ONBUILD COPY
the source was missing from the second dispatch Signed-off-by: Daniel Nephin <dnephin@docker.com>
Diffstat (limited to 'integration-cli/docker_api_build_test.go')
-rw-r--r--integration-cli/docker_api_build_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/integration-cli/docker_api_build_test.go b/integration-cli/docker_api_build_test.go
index feb20ee724..12d3374dd5 100644
--- a/integration-cli/docker_api_build_test.go
+++ b/integration-cli/docker_api_build_test.go
@@ -249,3 +249,28 @@ func (s *DockerSuite) TestBuildAPIUnnormalizedTarPaths(c *check.C) {
c.Assert(imageA, checker.Not(checker.Equals), imageB)
}
+
+func (s *DockerSuite) TestBuildOnBuildWithCopy(c *check.C) {
+ dockerfile := `
+ FROM ` + minimalBaseImage() + ` as onbuildbase
+ ONBUILD COPY file /file
+
+ FROM onbuildbase
+ `
+ ctx := fakecontext.New(c, "",
+ fakecontext.WithDockerfile(dockerfile),
+ fakecontext.WithFile("file", "some content"),
+ )
+ defer ctx.Close()
+
+ res, body, err := request.Post(
+ "/build",
+ request.RawContent(ctx.AsTarReader(c)),
+ request.ContentType("application/x-tar"))
+ c.Assert(err, checker.IsNil)
+ c.Assert(res.StatusCode, checker.Equals, http.StatusOK)
+
+ out, err := testutil.ReadBody(body)
+ c.Assert(err, checker.IsNil)
+ c.Assert(string(out), checker.Contains, "Successfully built")
+}