1
0
mirror of https://github.com/moby/moby.git synced 2025-07-30 18:23:29 +03:00

Fix ONBUILD COPY

the source was missing from the second dispatch

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin
2017-06-02 16:06:14 -04:00
parent aebcdf21b1
commit 3f26041577
4 changed files with 41 additions and 3 deletions

View File

@ -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")
}