Skip to content

Commit

Permalink
Add more TestBuild Dockerfiles, especially for making sure manual RUN…
Browse files Browse the repository at this point in the history
… echo '#!...' continues to work correctly
  • Loading branch information
tianon committed Dec 30, 2013
1 parent 2216268 commit c6dcee3
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions integration/buildfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,41 @@ run [ "$(cat /e)" = "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}
env FOO BAR
run [ "$FOO" = "BAR" ]
`,
nil,
nil,
},

// Environment overwriting
{
`
from {IMAGE}
env FOO BAR
run [ "$FOO" = "BAR" ]
env FOO BAZ
run [ "$FOO" = "BAZ" ]
`,
nil,
nil,
Expand Down

0 comments on commit c6dcee3

Please sign in to comment.