builder: Fix handling of VOLUME command where multiple volumes are

specified in a space delimited list.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
This commit is contained in:
Erik Hollensbe
2014-09-25 09:44:19 -07:00
parent 32b5d145fa
commit a5ca549a18
7 changed files with 47 additions and 13 deletions
+15 -2
View File
@@ -582,13 +582,26 @@ func TestBuildWithVolumes(t *testing.T) {
result map[string]map[string]struct{}
name = "testbuildvolumes"
emptyMap = make(map[string]struct{})
expected = map[string]map[string]struct{}{"/test1": emptyMap, "/test2": emptyMap}
expected = map[string]map[string]struct{}{
"/test1": emptyMap,
"/test2": emptyMap,
"/test3": emptyMap,
"/test4": emptyMap,
"/test5": emptyMap,
"/test6": emptyMap,
"[/test7": emptyMap,
"/test8]": emptyMap,
}
)
defer deleteImages(name)
_, err := buildImage(name,
`FROM scratch
VOLUME /test1
VOLUME /test2`,
VOLUME /test2
VOLUME /test3 /test4
VOLUME ["/test5", "/test6"]
VOLUME [/test7 /test8]
`,
true)
if err != nil {
t.Fatal(err)