Created
October 31, 2013 20:15
-
-
Save apatil/7256305 to your computer and use it in GitHub Desktop.
Reproduction of Docker issue
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
#!/bin/bash | |
# I ran this on an EC2 c1.medium instance with Docker version 0.6.3 on Ubuntu 12.04. | |
# I ran docker -d on tcp port 4243, and delivered 'stop' via the rest api | |
# because that's what I do in my production setup, but I don't know if that | |
# makes a difference. | |
# First, run ubuntu:12.04, and in it do | |
# echo -e '#!/bin/bash\nsleep 600' > cmd.sh | |
# chmod +x cmd.sh | |
# Then commit it and tag it as img-with-cmd | |
dockerCmd="docker -H 127.0.0.1:4243" | |
runCmd="$dockerCmd run -d img-with-cmd ./cmd.sh" | |
while [[ 1 ]] | |
do | |
ctrId=$($runCmd) | |
ctrRoute="http://127.0.0.1:4243/containers/$ctrId" | |
stopCmd="curl -s -X POST $ctrRoute/stop" | |
waitCmd="curl -s -X POST $ctrRoute/wait" | |
delCmd="curl -s -X DELETE $ctrRoute" | |
logCmd="$dockerCmd logs $ctrId" | |
sleep 1 | |
echo "stopping" | |
echo $($stopCmd) | |
#echo "logs" | |
#echo $($logCmd) | |
echo "status" | |
echo $($waitCmd) | |
$deleteCmd | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment