Merge pull request #15664 from skatsuta/fix-parse-null

builder: avoid parsing null- string to nil slice (issue #15634)
This commit is contained in:
Doug Davis
2015-08-19 09:06:20 -07:00
4 changed files with 32 additions and 0 deletions
+23
View File
@@ -5444,3 +5444,26 @@ func (s *DockerTrustSuite) TestBuildContextDirIsSymlink(c *check.C) {
c.Fatalf("build failed with exit status %d: %s", exitStatus, out)
}
}
// Issue #15634: COPY fails when path starts with "null"
func (s *DockerSuite) TestBuildNullStringInAddCopyVolume(c *check.C) {
name := "testbuildnullstringinaddcopyvolume"
ctx, err := fakeContext(`
FROM busybox
ADD null /
COPY nullfile /
VOLUME nullvolume
`,
map[string]string{
"null": "test1",
"nullfile": "test2",
},
)
defer ctx.Close()
c.Assert(err, check.IsNil)
_, err = buildImageFromContext(name, ctx, true)
c.Assert(err, check.IsNil)
}