Skip to content

Instantly share code, notes, and snippets.

@fancyremarker
Created August 11, 2015 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fancyremarker/dec9c00a92ecea88d20d to your computer and use it in GitHub Desktop.
Save fancyremarker/dec9c00a92ecea88d20d to your computer and use it in GitHub Desktop.
Example: db-launch script to launch any Aptible standardized database image
db-launch ()
{
container=$(head -c 32 /dev/urandom | md5);
passphrase=${PASSPHRASE:-foobar};
image="${@: -1}";
docker create --name $container $image;
docker run --volumes-from $container -e USERNAME=aptible -e PASSPHRASE=$passphrase -e DB=db $image --initialize;
docker run --volumes-from $container $@
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment