Skip to content

Instantly share code, notes, and snippets.

@fsouza
Last active December 23, 2015 05:09
Show Gist options
  • Save fsouza/6584979 to your computer and use it in GitHub Desktop.
Save fsouza/6584979 to your computer and use it in GitHub Desktop.
#!/bin/bash
PREFIX=registry.cloud.tsuru.io/tsuru/
read command
for image in "$@"
do
echo "Generating $image... "
full_image=${PREFIX}${image}
id=`docker -H 127.0.0.1:4243 run -d $full_image $command`
status=`docker -H 127.0.0.1:4243 wait $id`
if [ "x$statusx" = "x0x" ]
then
docker -H 127.0.0.1:4243 commit $id $full_image
fi
docker -H 127.0.0.1:4243 rm $id
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment