Created
August 11, 2015 21:46
-
-
Save fancyremarker/dec9c00a92ecea88d20d to your computer and use it in GitHub Desktop.
Example: db-launch script to launch any Aptible standardized database image
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
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