Last active
April 28, 2016 15:50
-
-
Save RomanSaveljev/55b81155531803d68c52 to your computer and use it in GitHub Desktop.
Docker bug report additional stuff
This file contains hidden or 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
#!sh | |
dockerfile() { | |
cat <<EOF | |
FROM debian:8 | |
RUN echo 123 >/a && printf abc >/b | |
RUN echo 456 >/a && echo def >>/b | |
EOF | |
} | |
setup() { | |
IMG=$(dockerfile | docker build -q -) | |
[ -n "$IMG" ] | |
echo $IMG | |
} | |
teardown() { | |
[ -z "$IMG" ] || docker rmi $IMG | |
} | |
@test 'Latest file contents' { | |
docker history $IMG | |
run docker run --rm $IMG cat /a | |
echo $output | |
[ "$status" -eq 0 ] | |
[ "$output" == "456" ] | |
run docker run --rm $IMG cat /b | |
[ "$status" -eq 0 ] | |
[ "$output" == "abcdef" ] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment