|
@@ -3728,6 +3728,9 @@ ENV FROM hello/docker/world
|
|
|
ENV TO /docker/world/hello
|
|
|
ADD $FROM $TO
|
|
|
RUN [ "$(cat $TO)" = "hello" ]
|
|
|
+ENV abc=def
|
|
|
+ENV ghi=$abc
|
|
|
+RUN [ "$ghi" = "def" ]
|
|
|
`
|
|
|
ctx, err := fakeContext(dockerfile, map[string]string{
|
|
|
"hello/docker/world": "hello",
|
|
@@ -3770,6 +3773,26 @@ ENV abc 'yyy'
|
|
|
RUN [ $abc = \'yyy\' ]
|
|
|
ENV abc=
|
|
|
RUN [ "$abc" = "" ]
|
|
|
+
|
|
|
+# use grep to make sure if the builder substitutes \$foo by mistake
|
|
|
+# we don't get a false positive
|
|
|
+ENV abc=\$foo
|
|
|
+RUN [ "$abc" = "\$foo" ] && (echo "$abc" | grep foo)
|
|
|
+ENV abc \$foo
|
|
|
+RUN [ "$abc" = "\$foo" ] && (echo "$abc" | grep foo)
|
|
|
+
|
|
|
+ENV abc=\'foo\'
|
|
|
+RUN [ "$abc" = "'foo'" ]
|
|
|
+ENV abc=\"foo\"
|
|
|
+RUN [ "$abc" = "\"foo\"" ]
|
|
|
+ENV abc "foo"
|
|
|
+RUN [ "$abc" = "\"foo\"" ]
|
|
|
+ENV abc 'foo'
|
|
|
+RUN [ "$abc" = "'foo'" ]
|
|
|
+ENV abc \'foo\'
|
|
|
+RUN [ "$abc" = "\\'foo\\'" ]
|
|
|
+ENV abc \"foo\"
|
|
|
+RUN [ "$abc" = "\\\"foo\\\"" ]
|
|
|
`
|
|
|
ctx, err := fakeContext(dockerfile, map[string]string{
|
|
|
"hello/docker/world": "hello",
|