Created
February 6, 2014 01:29
-
-
Save bkreider/8836867 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dockerfile: | |
=============== | |
FROM ubuntu | |
MAINTAINER bkreider | |
ADD return1.sh /root/return1.sh | |
ADD return0.sh /root/return0.sh | |
CMD ["/root/return1.sh"] | |
================= | |
return1.sh: | |
=============== | |
#!/bin/bash | |
/root/return0.sh | |
/root/return0.sh | |
ret=1 | |
echo "return1.sh: $ret" | |
exit $ret | |
================ | |
return0.sh: | |
=============== | |
#!/bin/bash | |
ret=0 | |
echo "Return0.sh: $ret" | |
exit $ret | |
=============== | |
Example of running the container: | |
bkreider@vagrant:~/docker$ docker run 679fd4dc530e | |
Returned status: 0 | |
Returned status: 0 | |
Returned status: 1 | |
bkreider@vagrant:~/docker$ echo $? | |
0 | |
bkreider@vagrant:~/docker$ docker run 679fd4dc530e | |
Returned status: 0 | |
Returned status: 0 | |
Returned status: 1 | |
bkreider@vagrant:~/docker$ echo $? | |
1 | |
bkreider@vagrant:~/docker$ docker run 679fd4dc530e | |
Returned status: 0 | |
Returned status: 0 | |
Returned status: 1 | |
bkreider@vagrant:~/docker$ echo $? | |
1 | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
1505f723832b 679fd4dc530e /root/test_two.sh 10 seconds ago Exit 1 sharp_morse | |
f158d1f4c4fd 679fd4dc530e /root/test_two.sh 17 seconds ago Exit 1 tender_fermat | |
688139665494 679fd4dc530e /root/test_two.sh 25 seconds ago Exit 1 angry_fermat | |
fb2d1ee381cd 679fd4dc530e /root/test_two.sh 35 seconds ago Exit 1 condescending_tesla | |
c1e71afbf881 679fd4dc530e /root/test_two.sh 40 seconds ago Exit 1 sharp_darwin | |
a128fd2006cf 679fd4dc530e /root/test_two.sh 45 seconds ago Exit 1 ecstatic_engelbart | |
564436ec3f35 679fd4dc530e /root/test_two.sh 50 seconds ago Exit 1 romantic_heisenberg | |
bc1d3ad02880 679fd4dc530e /root/test_two.sh 55 seconds ago Exit 1 prickly_einstein |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment