mirror of https://github.com/docker/docs.git
Add more TestBuild Dockerfiles, especially for making sure manual RUN echo '#!...' continues to work correctly
This commit is contained in:
parent
22162687df
commit
c6dcee329d
|
@ -132,6 +132,23 @@ run [ "$(cat /e)" = "blah" ]
|
||||||
[][2]string{{"/x", "hello"}, {"/", "blah"}},
|
[][2]string{{"/x", "hello"}, {"/", "blah"}},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Comments, shebangs, and executability, oh my!
|
||||||
|
{
|
||||||
|
`
|
||||||
|
FROM {IMAGE}
|
||||||
|
# This is an ordinary comment.
|
||||||
|
RUN { echo '#!/bin/sh'; echo 'echo hello world'; } > /hello.sh
|
||||||
|
RUN [ ! -x /hello.sh ]
|
||||||
|
RUN chmod +x /hello.sh
|
||||||
|
RUN [ -x /hello.sh ]
|
||||||
|
RUN [ "$(cat /hello.sh)" = $'#!/bin/sh\necho hello world' ]
|
||||||
|
RUN [ "$(/hello.sh)" = "hello world" ]
|
||||||
|
`,
|
||||||
|
nil,
|
||||||
|
nil,
|
||||||
|
},
|
||||||
|
|
||||||
|
// Environment variable
|
||||||
{
|
{
|
||||||
`
|
`
|
||||||
from {IMAGE}
|
from {IMAGE}
|
||||||
|
@ -142,6 +159,19 @@ run [ "$FOO" = "BAR" ]
|
||||||
nil,
|
nil,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Environment overwriting
|
||||||
|
{
|
||||||
|
`
|
||||||
|
from {IMAGE}
|
||||||
|
env FOO BAR
|
||||||
|
run [ "$FOO" = "BAR" ]
|
||||||
|
env FOO BAZ
|
||||||
|
run [ "$FOO" = "BAZ" ]
|
||||||
|
`,
|
||||||
|
nil,
|
||||||
|
nil,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
`
|
`
|
||||||
from {IMAGE}
|
from {IMAGE}
|
||||||
|
|
Loading…
Reference in New Issue