Skip to content

Instantly share code, notes, and snippets.

@vyshane
Last active August 29, 2015 14:07
Show Gist options
  • Save vyshane/a007597b4a0d984b8010 to your computer and use it in GitHub Desktop.
Save vyshane/a007597b4a0d984b8010 to your computer and use it in GitHub Desktop.
Example Docker build and run script
#!/usr/bin/env bash
org=kojai
app=web-services
branch=`git rev-parse --abbrev-ref HEAD`
if [ "$branch" == master ]; then
branch=latest
fi
docker build -q -t $org/$app:$branch .
docker stop $org-$app
docker rm -f $org-$app
docker run -d \
-p 80:80 \
--name $org-$app \
--link kojai-mongodb:db \
$org/$app:$branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment