Add tests from `FROM scratch` and `FROM SCRATCH`
@@ -174,6 +174,16 @@ FROM nginx
COPY . /
`
+const fromScratch = `
+FROM scratch
+ADD ./file /etc/file
+`
+
+const fromScratchUppercase = `
+FROM SCRATCH
+ADD ./file /etc/file
+`
+
type fakeImageFetcher struct {
fetched []string
}
@@ -437,6 +447,20 @@ func TestGetDependencies(t *testing.T) {
expected: []string{"Dockerfile"},
fetched: []string{"ubuntu:14.04"},
},
+ {
+ description: "from scratch",
+ dockerfile: fromScratch,
+ workspace: ".",
+ expected: []string{"Dockerfile", "file"},
+ fetched: nil,
+ },
+ {
+ description: "from scratch, ignoring case",
+ dockerfile: fromScratchUppercase,
+ workspace: ".",
+ expected: []string{"Dockerfile", "file"},
+ fetched: nil,
+ },
}
for _, test := range tests {
